Solve "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!”

Published at 10 Oct 2024

When connecting to another device using SSH it's probable you will receive the following warning.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:v8wTNMITwck7XKblLxcqIB09/cLK+a2tbJ+av1kry9A.
Please contact your system administrator.

This happens when you have previously connected to that device but its fingerprint has been changed. A fingerprint can change if the device has been reinstalled.

To remove this warning and be able to connect to the device you should execute the following command.

ssh-keygen -R [IP]

You should replace [IP] with the IP of the device you're trying to connect. For example:

ssh-keygen -R 192.168.1.14