In this short article we will go over the fix for this warning message "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"
Here is the output for this type of warning:
[root@aodba]# ssh -i /home/ec2-user/KEY.pam ec2-user@11.111.11.222
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
3e:02:5b:61:b1:f1:1a:72:ed:89:88:c6:6a:79:c9:80.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /root/.ssh/known_hosts:1
RSA host key for 11.111.11.222 has changed and you have requested strict checking.
Host key verification failed.
[root@aodba]# ssh-keygen -R 11.111.11.222
/root/.ssh/known_hosts updated.
Original contents retained as /root/.ssh/known_hosts.old
[root@aodba]# ssh -i /home/ec2-user/NAT.pam [email protected]
The authenticity of host '11.111.11.222 (11.111.11.222)' can't be established.
RSA key fingerprint is 3e:02:5b:61:b1:f1:1a:72:ed:89:88:c6:6a:79:c9:80.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '11.111.11.222' (RSA) to the list of known hosts.