ubuntu20.04下,ssh正常登录(使用密钥对,ssh -i user.pem root@192.168.31.11),但升级到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