How to fix the error “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED”

When connecting to the server via ssh, you may encounter the following error:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
SHA256:eNi9x52Kjx1v8+FxLfbVS4H0p8CvZoCpd7QDaqwnICI.
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 IP.AD.RE.SS has changed and you have requested strict checking.
Host key verification failed.

This notification informs us that the ECDSA key fingerprint was changed for the server. There could be multiple reasons for the issue in this case. However, the most common reason is the certificate reissue.

To fix that issue, it is enough to execute the following command on the local PC in the terminal:

ssh-keygen -f "/root/.ssh/known_hosts" -R IP.AD.RE.SS

/root/.ssh/known_hosts – the route mentioned in the error

IP.AD.RE.SS – enter the IP address from the error message

That command will delete the invalid fingerprint. The SSH access will work without any issues after that.

Rate this article
Share this article
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
In this article