WARNING: Remote Host Identification has Changed

  • Mostly after change the server or change ssh keys we get following message
$ ssh mitesh@example.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
4e:24:e3:a6:83:da:48:ae:11:f3:5d:95:69:03:d3:cb.
Please contact your system administrator.
Add correct host key in /Users/Mitesh/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/Mitesh/.ssh/known_hosts:37
RSA host key for example.com has changed and you have requested strict checking.
Host key verification failed.

How to Fix:

$ ssh-keygen -R example.com
# Host example.com found: line 37 type RSA
/Users/Mitesh/.ssh/known_hosts updated.
Original contents retained as /Users/Mitesh/.ssh/known_hosts.old


Newsletter

Get updated when I create new content.
Unsubscribe whenever. Never any spam.

Note

I'm Tama. I turn down every ad, affiliate, and sponsor request I get. I write free resources that help people. If you enjoy my content, please consider supporting what I do.

Support my work