How to Generate SSH Key Fingerprints
Published:
An SSH fingerprint is a compact way to compare public keys. It helps answer whether two copies represent the same key, but it does not tell you whether that key belongs to the intended person or server. Establish that association through a trusted channel.
Calculate the fingerprint of a public key file
For an existing Ed25519 public key in your account, run:
ssh-keygen -lf ~/.ssh/id_ed25519.pub -E sha256
Use the path of the public key you actually want to inspect. -l displays a fingerprint, -f selects the input file, and -E sha256 explicitly selects SHA-256. The output includes a key size, fingerprint, optional comment and key type. See the OpenSSH ssh-keygen manual for the supported flags.
Compare the same public key in FATOPS
- Open the SSH public key inspector.
- Paste the complete single-line OpenSSH public key: the key type, Base64 key blob and optional comment.
- Select Inspect public key.
- Compare the SHA-256 fingerprint with the terminal result character for character.
The tool accepts standard RSA, Ed25519 and NIST ECDSA public keys. Private key files, SSH certificates and security-key variants are outside its supported input types. For a safe demonstration, use Load example rather than copying an account’s private key.
Know what is being hashed
An SSH fingerprint is calculated from the encoded key structure, not the literal text of the .pub file. Hashing the entire line with a generic text hash tool includes separators and comments and therefore gives a different result. Changing a comment should not change the key’s fingerprint; changing the underlying public key should.
This distinction helps debug a mismatch. First confirm that both commands use the same hash algorithm and public key. Then check whether one side accidentally hashed a file’s text, inspected a different account key, or copied only part of the key blob. Do not compare an older colon-separated MD5 fingerprint directly with a SHA-256 value.
Distinguish user keys from server host keys
A user public key may authorize account access through authorized_keys. A host public key identifies the SSH server. An administrator with trusted access to a server can inspect its public host key, for example:
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub -E sha256
Compare the fingerprint with the one presented to the connecting client through an authenticated administrative channel. A fingerprint obtained from the same untrusted connection does not independently establish identity.
Investigate unexpected changes
If a host fingerprint changes, check the server’s rebuild or rotation record before accepting the new key. A matching fingerprint identifies matching key material, not proof of private-key possession or authorization. The browser inspector performs local parsing and fingerprint calculation; it cannot verify the owner or contact the host.