ssh 连接“权限被拒绝”消息

pri*_*upi 2 ssh connection

当我执行命令时ssh localhost(在 Ubuntu 10.10 中),它会显示错误消息“权限被拒绝(公钥)”。可能是什么问题?

有什么问题sshd_config file in /etc/ssh吗?应该PasswordAuthentication设置为no? 我已将 设置PasswordAuthenticationno,但它仍然给我错误“权限被拒绝(公钥)”。

小智 5

您需要正确设置文件权限,试试这个..

 $chmod go-w ~/
 $chmod 700 ~/.ssh
 $chmod 600 ~/.ssh/authorized_keys
Run Code Online (Sandbox Code Playgroud)