Last Updated on 2021-10-11 by Clay
If you used ssh
command to connect to the remote server, but you got the following error message causing you can not connect:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 ECDSA key sent by the remote host is
SHA256:wruvASsAzradn/Acy0g0YwuDGBZb7ierhmL/fhhsSu4.
Please contact your system administrator.
Add correct host key in /Users/clay/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/clay/.ssh/known_hosts:13
ECDSA host key for ohio.cs.nccu.edu.tw has changed and you have requested strict checking.
Host key verification failed.
Don't be nervous.
Although it says that your system may be eavesdropped, but in fact many times, it may be because we have connected to this remote server in the past and added it to known_hosts file.
However, the remote server may has reinstalled or modified some settings, causing a warning message to appear on the connection through the ssh
command.
Solution
If you really want to connect quickly, the simple way is to directly use the ssh
command via root user; but if you don't want to do the same thing every time you connect, you can go to known_hosts file and delete the line contain remote server ip address.
Or you can delete the known_hosts file directly.
References
- https://www.digitalocean.com/community/questions/how-can-i-get-rid-of-warning-remote-host-identification-has-changed
- https://stackabuse.com/how-to-fix-warning-remote-host-identification-has-changed-on-mac-and-linux/