How to fix “REMOTE HOST IDENTIFICATION HAS CHANGED” warning?
If you see the following warning (aka host key verification failed) while trying to connect eg. yourdomain.com via SSH
1 2 3 4 5 6 7 8 9 10 11 12 13 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 ED25519 key sent by the remote host is SHA256:e4c1ZqAcpgLIPmtbTXWAAm5LM+1IYa7G/+NhT2hYaag. Please contact your system administrator. Add correct host key in C:\\Users\\xxxx/.ssh/known_hosts to get rid of this message. Offending ECDSA key in C:\\Users\\xxxx/.ssh/known_hosts:5 Host key for yourdomain.com has changed and you have requested strict checking. Host key verification failed. |
the solution is
1 | ssh-keygen -R yourdomain.com |
reconnect and type “yes” when “Are you sure you want to continue connecting (yes/no/[fingerprint])?” is prompted.
