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.

Linux Related Articles . . .

To generate a SHA256 certficate in linux all you need to do is run this openssl command and you will...
This a very useful One liner command to insert IP and hostname into /etc/hosts file and is particularly useful when...
Its possible to use awk in Alias command. I did that by simply just modifying some parenthesis and there you...
Its possible to run a script via Alias command. All you need is to modify the .bashrc and then source...
This article will guide you on creating a custom Self-signed SSL Certificate in no time. For creating one you would...