Date: 2016dec15
OS: Linux
Product: ssh, scp, sftp, openssh-clients
Q. What should I do about: "REMOTE HOST IDENTIFICATION CHANGED!" from ssh family of commands?
A. The message looks like:
scp file1 the-remote-host:/path
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
NN:NN:NN:NN:NN:NN:NN:NN:NN:NN:NN:NN:NN:NN:NN:NN.
Please contact your system administrator.
Add correct host key in /jsmith/.ssh/known_hosts to get rid of this message.
Offending key in /jsmith/.ssh/known_hosts:2
RSA host key for [the-remote-host]:22 has changed and you have requested strict checking.
Host key verification failed.
lost connection
How you deal with this message depends on what you know.
For example today I got this message because I updated the SSL key for the remote system. Since I know I did that, I know thee is no attack.
So I edited ~/.ssh/known_hosts and deleted the line for the remote system
and re-did the scp command. This time it worked.