操作系統為了安全,一般只允許普通用戶使用public_key登錄,這時如果以root用戶登錄,就會出現各種錯誤。下面是常見的錯誤及解決方案。
Permission denied (publickey)
這時因為root用戶沒有權限,不允許直接登錄,只允許以publickey登錄。修改/etc/ssh/sshd_config:
PermitRootLogin yes
Permission denied, please try again
PasswordAuthentication yes
如果還不能登錄,檢查AllowUsers和AllowGroups是否只允許部分用戶登錄。