Trying to ssh into a Linux server and getting "Host key verification failed", what now?

You should be greeted with a message simialir to the one below if you run into this issue, please make note of the number at the end of the following output "Offending RSA key in /Users/etcadmin/.ssh/known_hosts:7". In this example it is "7".

 

"Please contact your system administrator.
Add correct host key in /Users/etcadmin/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/etcadmin/.ssh/known_hosts:7
RSA host key for 147.153.99.69 has changed and you have requested strict checking.
Host key verification failed."

 

In your terminal please use the following command:

sed -i,bak '7d' .ssh/known_hosts

You would repalce the "7" with the number you recive on your terminal as discused above. Now please try and ssh into the system again and it should work just fine.

Joey Herzan
2016-04-29 22:21