known_hosts

How to handle "WARNING: POSSIBLE DNS SPOOFING DETECTED!" and "REMOTE HOST IDENTIFICATION HAS CHANGED!" error at ssh login time?

botond published March 2022, 06, Thu - 16:17 time
When you use ssh access, your computer (client) retrieves the server's ECDSA (Elliptic Curve Digital Signature Algorithm) fingerprint each time it connects, which it stores in the list of known servers during the first connection (by default in the ~ / .ssh / known_hosts file). From now on, for future ssh connections, our machine will recognize the ECDSA fingerprint of the remote machine, verifying that we are connecting to the exact same machine later. If the newly retrieved fingerprint does not match the previously stored version during a subsequent connection, ssh throws the following error: "WARNING: POSSIBLE DNS SPOOFING DETECTED!" and "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!". These error messages alert you to the possibility that you may be a victim of DNS spoofing, or that the server's ECDSA fingerprint, that is, the public key of the SSH server, has changed.