Bad server host key: Invalid key length

You may encounter the following error when SSHing to legacy systems.

Bad server host key: Invalid key length

This happens due to older devices not using a larger key size.

A work around is to add an exception in your SSH config file allowing a smaller key size for specific hosts.

You can do this by adding the following to your ~/.ssh/config file. Change the IP addresses to the hosts you are trying to connect to. You can add more IPs if needed. Just ensure there is a space between them.

Host 192.168.1.20 192.168.1.1
     RSAMinSize 1024

Leave a Reply

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