Skip to content

Instantly share code, notes, and snippets.

@ataliba
Created April 16, 2012 02:17
Show Gist options
  • Save ataliba/2396042 to your computer and use it in GitHub Desktop.
Save ataliba/2396042 to your computer and use it in GitHub Desktop.
Warning: Remote Host Identification Has Changed error and solution
Hello,
this a simple solution for this problem. If you want to access a host with your ssh and receive this error :
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
39:e5:ef:60:f1:ae:08:b9:46:36:7c:7d:61:e8:c9:41.
Please contact your system administrator.
Add correct host key in /home/ataliba/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/ataliba/.ssh/known_hosts:17
RSA host key for host.host.com.br has changed and you have requested strict checking.
Host key verification failed.
You get this message when you access a host was reinstalled.
To solve this ...
$ ssh-keygen -R {server.name.com}
$ ssh-keygen -R {ssh.server.ip.address}
$ ssh-keygen -R server.example.com
Sample output :
/home/ataliba/.ssh/known_hosts updated.
Original contents retained as /home/ataliba/.ssh/known_hosts.old
@ZiaUrRehman-GBI
Copy link

Thanks that work for me

@daniel-iroka
Copy link

Hello. Please are we going to type it out exactly the way it is written or am I to put something else in place of the curly braces and server.name.com as well as the other servers commands? I received this error when trying to git push.

@pedrofernandesfilho
Copy link

In this post https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/ you can get more information and samples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment