Practical security for everyday technology.

An SSH host-key warning concerns the server before your login password

Laptop terminal beside a small server appliance.
AI-generated photographic illustration; not documentary photography.

Your usual SSH connection suddenly reports that the remote host identification has changed. Retyping the account password will not resolve the question the client is asking. It is checking the server’s identity against the key it remembers.

Does it mean the server has been hacked?

Not necessarily. A rebuild or a deliberate host-key replacement can cause a legitimate change. Connecting to a different machine through a changed address can also produce a mismatch. The warning cannot tell you, by itself, which explanation applies.

GitHub’s SSH troubleshooting documentation explains why a changed key should be checked against an official, trustworthy source. The same principle applies to your own server: verify the replacement key through a route you already trust, such as the provider’s authenticated console or the administrator responsible for the change.

What should I compare?

Compare the fingerprint for the correct host and key type, not just a familiar-looking beginning. Confirm that the hostname, address and port identify the intended service. A fingerprint copied from the suspicious connection itself is not independent verification of that connection.

Record the explanation for an expected change. For example, a documented server rebuild followed by a matching console fingerprint provides a different basis for proceeding than an unexplained error encountered on a new network.

Should I delete known_hosts?

Do not erase the whole file or disable checking simply to make the warning disappear. Oracle’s OpenSSH guide describes how the known-hosts record is used. Once the new identity has been verified, update only the relevant record using the procedure appropriate to your client.

If you cannot verify it, stop the connection and ask the administrator. This is a good moment to preserve the warning text without publishing private addresses or account details in a public support post.

There are two separate relationships in an SSH session: your client checks which server it is reaching, and the server checks whether your account may log in. Keeping those questions separate makes this warning much easier to handle calmly.