Was messing in a lab and found this issue, and the fix is quick simple.

If anyone knows how SSH and how it works, the idea is very simple why when I tried to SSH to a IP address I have been using as the guinea pig for so many labs, issue is the key found from the new vm I built, my local machine already had a key for the same IP I am trying to SSH to.

wzambrano:~ wzambrano$ ssh wzambrano@172.16.223.16
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is........... <output omitted>

To fix this and to continue using my guinea pig IP address, we have to clear out that key for that particular IP address with this command

wzambrano:~ wzambrano$ ssh-keygen -R 172.16.223.16
# Host 172.16.223.16 found: line 39 type RSA
/Users/wzambrano/.ssh/known_hosts updated.
Original contents retained as /Users/wzambrano/.ssh/known_hosts.old

Note that the old key has also been saved as .old in case I ever needed the original.

The authenticity of host '172.16.223.16 (172.16.223.16)' can't be established.
RSA key fingerprint is 3d:0f:20:9e:17:016:5:9c:e:9f:9c:e:f5:5d:d4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.16.223.16' (RSA) to the list of known hosts.

Now it works!

 

 

William Zambrano

William Zambrano

NYC networkers is run by William Zambrano, a passionate network engineer who has been in the IT industry for eight years who posts up blog articles, YouTube videos, and holds meetup.com events in the NYC area. He lives in Queens, New York and has consulted in various different companies in the NY area. Previously William worked as a Cisco Certified Systems Instructor (CCSI) but now currently works for Arista Networks serving as a Systems Engineer. William can be reached by email at willzambrano@gmail.com

More Posts - Website

Follow Me:
Twitter