Just to improve tumbleweed's answer which has a dead link in it for finding the old list of algorithms.
First decide on a list of algorithms. To find the old list, use ssh -vv
:
ssh -vv somehost
And look for the 2 lines like "host key algorithms: ..." where the first appears to be the server's offer, and the 2nd is the client's. Or to pick out those 2 lines automatically, try this (and to exit hit ctrl+d):
ssh -vv somehost 2>&1 | grep "host key algorithms:"
Now filter it down... you should remove all the dss/dsa ones since they are long obsolete, and you also wanted to remove ecdsa (as do I), so for example if you had:
[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
You should end up with:
[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
Now edit your config. For your own config:
vim ~/.ssh/config
For the system wide config:
sudo vim /etc/ssh/ssh_config
Add a new line, either globally:
HostKeyAlgorithms [email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
or for a specific host (not ideal for server wide config):
Host somehost
HostKeyAlgorithms [email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
Instead of the list I entered, paste the list you derived from the ssh -vv
output, not incluing the "host key algorithms:" part.