No Matching Host Key Type Found

I was trying to SSH into a server that I had accessed many times before with no issues. All of a sudden, I was getting this error message:

Unable to negotiate with <ip_address> port <port_no>: no matching host key type found. Their offer: ssh-rsa,ssh-dss

I knew I wasn’t mistyping something as I was using an SSH config file, so I knew I was using all the same options, IP, and port as the previous time I had connected.

After doing some digging, I realized that I had not logged into this server since it had been updated to use OpenSSH 8.8. Being a shared hosting environment, I did not have access to any server-side configurations, so I had to figure out a fix on my end. A quick and dirty workaround is to add the following to your SSH config file:

HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

Or do add this to your connection string:

-oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa

I had to accept the RSA key fingerprint/add this to my known hosts, but other than that, it was all smooth sailing to connect to the server.