Problem:

If you get this warning/error when you run the ssh command:

Solution:

Avoid it like this: add these options to your ssh command

The total command looks like this:

Here is what the 2 options say in the man page:

What they mean is this

UserKnownHostsFile, instead of looking at ~/.ssh/known_hosts (/home/kossboss/.ssh/known_hosts) to check for known hosts, instead check /dev/null (which is empty), so there wont be any offending keys there. Setting StrictHostKeyChecking to no will add the new key to the specified host file (by default its ~/.ssh/known_hosts or in my case /home/kossboss/.ssh/known_hosts) but since we changed it to /dev/null, the key will be written nowhere, and the system is unchanged. The end result, is you connect to the server, even if the host key doesnt match what your known_hosts key file says. The security risk is man in the middle attacks. However if your confident that the server is correct, then don’t worry.

NOTE: another solution is to remove the 3rd line from /home/kossboss/.ssh/known_hosts (why the 3rd? because look at the output “Offending key in /home/kossboss/.ssh/known_hosts:3”)

Leave a Reply

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