Error ‘no hostkey alg’ while trying to connect via ssh fix

This error usually happens when old ssh client tries to connect to modern ssh server, with doesn’t support old RSA ciphers by default.

To fix this and be able to connect from old box, add to /etc/ssh/sshd_config on the server side following:

HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

It must be added before row:

Include /etc/ssh/sshd_config.d/*.conf

Otherwise, according to forums, it might not work.

After adding options restart ssh daemon (you won’t lose your current connection):

systemctl restart sshd

Links:

  1. https://unix.stackexchange.com/questions/679451/sshd-no-hostkey-alg-fixed-but-still-confused

Leave a Reply

Your email address will not be published. Required fields are marked *