服务器测评网
我们一直在努力

ssh 登陆服务器提示:No more authentication methods to try,Permission denied (publickey) 错误的解决办法

简言之就是ssh client更新了,不支持rsa的私钥,导致无法登陆。

ssh登陆服务器,出现类似下面的提示:

debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/user/.ssh/id_rsa RSA ... agent
debug1: send_pubkey_test: no mutual signature algorithm <-- ssh-rsa is not enabled 
debug1: No more authentication methods to try.
user@hostname: Permission denied (publickey).

本来以为是key弄错了,或者服务器被黑了。加上 -v 参数才发现问题。

解决方案也很简单,就是在 ~/.ssh/config 中增加:

Host *
    ServerAliveInterval 30
    PubkeyAcceptedKeyTypes +ssh-rsa

如果是出现:no matching host key type found. Their offer: ssh-rsa,ssh-dss 的错误,还需要配置:

HostKeyAlgorithms=ssh-rsa,ssh-dss
赞(0) 打赏
未经允许不得转载:好主机测评网 » ssh 登陆服务器提示:No more authentication methods to try,Permission denied (publickey) 错误的解决办法

评论 抢沙发

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫