I see this a lot with legacy Cisco embedded systems whose firmware can no longer be upgraded to modern ssh standards.
In addition to Host Key Algorithm, you may need to use an obsoleted Key Exchange Algorithm, and/or Cipher specification as well.
Bash Example:
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1\
-oHostKeyAlgorithms=+ssh-rsa\
-oCiphers=+aes256-cbc\
<user>@asa5505
The good news is that OpenSSH (what I use) usually tells me what algorithms or cyphers are being offered - otherwise I might have to do a lot of trial and error.
If I do, available protocols can be listed in OpenSSH with:
ssh -Q [ciphers|hostkeyalgorithms|kexalgorithms|...]
Update:
As there seems a lot of interest in doing this using ssh_config (thanks, Bob,Z,et al), I will provide an example for that method:
############################################
# ~/.ssh/config
Host 'asa5505*'
KexAlgorithms +diffie-hellman-group1-sha1
HostKeyAlgorithms +ssh-rsa
Ciphers +aes128-cbc
Because these protocols have been deprecated for security reasons, you should restrict default usage with a "Host" or "Match" qualification so they are only used on those legacy targets that require them.
Likewise, you should avoid putting these exceptions into /etc/ssh/ssh_config or under /etc/ssh/ssh_config.d/ unless your intent is to have all current and future users utilize them by default.
For all the gritty details, see:
man ssh_config
ssh_config
. – Bob Nov 28 '22 at 05:47