Tuesday, 2 October 2012

Establishing ssh key pair when “Host key verification failed”


Somtime you will get like following you try to other system via SSH

$ ssh root@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 3f:1b:f4:bd:c5:aa:c1:1f:bf:4e:2e:cf:53:fa:d8:59.
Please contact your system administrator.Add correct host key in
 /home/guest/.ssh/known_hosts to get rid of this message.Offending key in /home/guest/.ssh/known_hosts:3 RSA host key for 192.168.1.1has changed and you have requested strict checking.Host key verification failed.

It's simple error.Just you remove that unknown host.Then that will work fine

            "ssh-keygen -R hostname"
           
This deletes the offending key from the known_hosts or open it up and delete the entry for the offending ip/hostname

Example:

            "rm -f /home/user/.ssh/known_hosts"

No comments:

Post a Comment