Get rid of SSH error message "WARNING REMOTE HOST IDENTIFICATION HAS CHANGED"

In Linux when you try to SSH it may at times give you this warning that REMOTE HOST IDENTIFICATION HAS CHANGED. It usually happens when the hostname or IP has changed of a host or the host was rebooted and generated a new fingerprint Key ID. No need to worry, it can be removed by a single command and you would be up and running in no time.

Warning message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
7b:c3:5c:22:96:03:7b:e8:6d:98:87:5b:28:1d:4c:08.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending key in /home/user/.ssh/known_hosts:2

Run this command to delete the offending key in .ssh/known_hosts

# sed -i '3d' ~/.ssh/known_hosts

*Replacing "3d" with the number of offending key.

In the above example see "line 11"

# sed -i '2d' ~/.ssh/known_hosts

If you encounter any errors during the process, let us know via Contact Us and will get it resolved promptly.

Most Read Articles

Add/Detect a new disk in ...

Written By Farooq Mohammed Ahmed on Sunday, 11 January 2015 19:22
Add/Detect a new disk in ...

Replace SSL Certificates ...

Written By Farooq Mohammed Ahmed on Friday, 16 December 2016 08:05
Replace SSL Certificates ...

Using awk in Alias Comman...

Written By Farooq Mohammed Ahmed on Friday, 19 February 2016 14:22
Using awk in Alias Comman...

Sed - Insert Text before ...

Written By Farooq Mohammed Ahmed on Monday, 20 November 2017 00:58
Sed - Insert Text before ...

Script to Monitor Nagios ...

Written By Farooq Mohammed Ahmed on Monday, 18 July 2016 22:48
Script to Monitor Nagios ...