SSH Error – ‘Host key verification failed’

So what is it and why do I need to know about it?

SSH, also known as Secure Socket Shell, is a network protocol that provides administrators with a secure way to access a remote computer. SSH also refers to the suite of utilities that implement the protocol. Secure Shell provides strong authentication and secures encrypted data communications between two computers connecting over an insecure network such as the Internet. SSH is widely used by network administrators for managing systems and applications remotely, allowing them to log in to another computer over a network, execute commands and move files from one computer to another.

The encrypted keys for each computer are stored in a file /home/User/.ssh       known_hosts

You will need to turn on View Hidden Files in your file explorer to see the .ssh folder and all other system folders and files.

When you look at the known_hosts file there will be a line for each computer that looks like this:

|1|guO7PbLLb5FWIpxNZHF03ESTTKg=|r002DA8L2JUYRVykUh7jcVUHeYE= ssh-rsa AAAAB3NzaC1yc2EAAFADAQABAAABAQ....etc

The problem is that the hostname is “Hashed”. This is great from a security point of view. But not so useful in a “home network scenario”.

So we need to turn off the setting “HashKnownHosts = yes” to “HashKnownHosts =no “

This setting is located at /etc/ssh     ssh_config  at the bottom of the file for me anyway!

After you change this setting you will need to delete the known_hosts file. You will then have to reauthorize the connection to each of your computers, again. But this time when you look at the file, there will now be an I.P. Address at the start of each line.

[]:22 ssh-rsa AAAAB3NzaC1yc2EAAFADAQABAAABAQ....etc

So next time you have an error you won’t need to delete the known_hosts file but instead just edit it and delete the one line that correlates to the computer that you’re trying to connect to.


Need Help?

Leave a Reply

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