新版的RHEL 6.9 Update7 ,或是更之前的版本就已經是這樣,沒有測試過不清楚。
(rhel-server-6.9-update-7-x86_64-dvd.iso)
SSHD 預設不開放密碼驗證登入,須到 /etc/ssh/sshd_config 中修改相關設定。
Error Message :
ssh 192.168.101.203 -l root
root@192.168.101.203: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
用 ssh 192.168.101.203 -l root -v 下來 Debug。
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:TAq9N5E4XQXrOK0E/1DvpCOpmDEFRuNJZyNApNyfKgo /Users/Joe/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /Users/Joe/.ssh/id_dsa
debug1: Trying private key: /Users/Joe/.ssh/id_ecdsa
debug1: Trying private key: /Users/Joe/.ssh/id_ed25519
debug1: No more authentication methods to try.
上面可以看出驗證證書後沒有密碼驗證。
解決方式:
vim //etc/ssh/sshd_config
找到下面這行,no,改成yes。
PasswordAuthentication yes
PermitRootLogin yes (如果要開放root登入可以順便改)
Restart Service. Done.