ubuntu22.04 ssh 连不上

现象:

ubuntu20.04下,ssh正常登录(使用密钥对,ssh -i user.pem [email protected]),但升级到ubuntu22.04时无法正常登录,提示:

No suitable authentication method found to complete authentication.

或者

permission deny (publickey)

原因

ubuntu22.04取消了rsa sha1登录,导致原来的证书已无法登录

解决方法

1、重新制作证书
2、在服务器上执行以下命令

sudo sh -c "echo 'HostKeyAlgorithms +ssh-rsa' >> /etc/ssh/sshd_config"
sudo sh -c "echo 'PubkeyAcceptedKeyTypes +ssh-rsa' >> /etc/ssh/sshd_config"
sudo systemctl restart sshd

你可能感兴趣的:(ubuntu,linux,ssh,ubuntu22.04,ssh,登录,rsa,sha1)