How to verify an SSH host key fingerprint (and why)

The first time you connect over SSH, check the server's host key fingerprint. Here is how to compare it in ServerAlyzer and what a mismatch means.

SecurityPedro Loyola2 min read

To verify an SSH host key, compare the SHA-256 fingerprint your client shows on the first connection with the one the server reports about itself, for example with ssh-keygen -lf. If they match, trust it; if not, stop. ServerAlyzer asks you to do exactly this before it monitors a server.

What is an SSH host key fingerprint?

Every SSH server has its own host key. The fingerprint is a short hash of that key, and it is how your client recognises the server later. If someone sits between you and your server, they cannot present the same key, so the fingerprint would differ.

How do I check it on the server?

On the server (over a console or a session you already trust), list the fingerprints of its host keys:

for f in /etc/ssh/ssh_host_*.pub; do ssh-keygen -lf "$f"; done

Each output line includes a value starting with SHA256:. A server can have several key types (ED25519, ECDSA, RSA). Compare the whole string with the one shown by the client.

What does ServerAlyzer do?

The first time you connect to a server, ServerAlyzer shows the SHA-256 fingerprint of its host key. You approve it only if it matches what the server reports. If the key later changes, the app blocks the connection instead of silently accepting it. Details are in the host key trust guide and the SSH security guide.

Why a mismatch is not always an attack

A different fingerprint can be harmless: a reinstalled system, a restored backup or regenerated keys. Still, do not assume it. Confirm the change on the server first, and only then trust the new key.

Try it

ServerAlyzer Community is free and open source (MIT). Get it from the Microsoft Store or GitHub. Addresses, metrics, credentials and logs stay on your PC.

FAQ

What is a host key fingerprint?

A short SHA-256 hash of the server's public host key, used to recognise the server on later connections.

How do I get the fingerprint from my server?

Run ssh-keygen -lf on the server's public host key files in /etc/ssh/ and compare the SHA256: value.

What happens in ServerAlyzer if the host key changes?

The app blocks the connection until you check and explicitly trust the new key.

Is it safe to accept the fingerprint without checking?

It works, but you lose the protection against someone impersonating your server. Comparing it is quick.

  • ssh
  • security
  • homelab
  • host key

Keep reading

All articles

Give your servers a place on your desktop.

Install for free, connect your first server and see CPU, memory and disk in one view.