Source: Unable to add old HostKeyAlgorithms Ciphers KexAlgorithms to sshd_config no hostkey alg error
Source: SSH connection fails with messages “no hostkey alg”
When attempting to establish an SSH connection, you might encounter an error message stating “no hostkey alg”. This is because RHEL 9 only supports SHA2 hashes for RSA host keys, hence they are incompatible with the old linux’s SHA1-based RSA host keys..
However, the old linux can connect to RHEL 9 using ECDSA keys:
ssh -o Hostkeyalgorithms=ecdsa-sha2-nistp256 ServerHostname/ServerIP
You can add the following in /etc/ssh/ssh_config or ~/.ssh/ssh_config:
Host ServerHostname/ServerIP
Hostkeyalgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521