Recently, I upgraded my Ubuntu from 20.04 to 22.04, and after the upgrade, SSH connections are not working.
Cause:
Ubuntu 22.04 has deprecated RSA SHA1 login, causing the existing certificates to be unable to connect.
Solution:
Run the following commands on the server:
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