Thursday, March 31, 2011

Removing old keys in your known_hosts file

If you happen to have changed server IP address and while at it you get this message doing a remote connnection:

ssh ants@192.168.1.1
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
eb:e8:de:47:00:77:2c:14:28:20:db:18:4c:9f:69:02.
Please contact your system administrator.
Add correct host key in /home/ants/.ssh/known_hosts to get rid of this message.
Offending key in /home/ants/.ssh/known_hosts:13
RSA host key for 192.168.1.1 has changed and you have requested strict checking.
Host key verification failed.

You will have to remove the entry by editing your known_hosts file.  Remove the old entry, in this case its on line "13" save the file and try connecting again, accept the new one when prompted.

Done.

No comments:

Post a Comment