To manage my multiple machines and test computers on my local network I use SSH, and often after reinstalling a test machine I want to connect back by SSH and my Mac just pops me back this message :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
noktec:release Noktec$ ssh xavier@192.168.0.2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 ******************************** Please contact your system administrator. Add correct host key in /Users/Noktec/.ssh/known_hosts to get rid of this message. Offending key in /Users/Noktec/.ssh/known_hosts:12 RSA host key for 192.168.0.2 has changed and you have requested strict checking. Host key verification failed. |
I usually find this message quiet annoying, but knows the commands to avoid this problem, but today while speaking with a friend, he told me that he was usually deleting the SSH keys by hand in its “known_hosts” file. As there are some appropriate commands to do this I thought it would be a good idea to post them on my blog, and here they are :
1 2 3 |
ssh-keygen -R machine-name ssh-keygen -R 192.168.0.2 ssh-keygen -R MyMachine.com |
And that’s it, you will now be able to delete the ssh key without having to modify your “known_hosts” file by hand.
Post a Comment