ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain

Posted by     "lxg" on Tuesday, June 4, 2024

为什么出现

当出现ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 时候一般是免密码登陆丢了,我们可以重新设置下免密登陆。

解决

重新生成公私钥

执行如下命令。此命令会覆盖,注意备份

ssh-keygen

本地公钥文件复制公钥信息

将id_rsa.pub中的公钥复制出来

vim /root/.ssh/id_rsa.pub

将公钥复制到authorized_key

cat ~/.ssh/id_rsa.pub >> /root/.ssh/authorized_key

验证

ssh localhost

「真诚赞赏,手留余香」

Little Star Blog

真诚赞赏,手留余香

使用微信扫描二维码完成支付