When you ssh into a remote box for the first time or if the remote host's key fingerprint has changed (from what's stored in your known_hosts file) you get a warning and you are shown the fingerprint of the host's key.

Does it compromise your security if you share the fingerprint publicly (i.e. with potential attackers)? Or is this a case where it's okay for everyone to know the fingerprint of a server, because ssh is doing something behind the scenes (from my perspective as a simple user) such that the fingerprint can't be spoofed, even if it's known?

Since you can see the fingerprint just by attempting to ssh in to the server using a nonsense account, I assume that means the fingerprint should be okay to be publicly shared (but you know what happens when you assume...).

2 Answers 2


The server key fingerprint is a hash of the server's public key, which is, by definition, public. Anybody can obtain the server's public key by simply connecting to it, since the server sends its public key in the initial steps of the protocol. In fact, that's just what you do with your SSH client: you connect to the server, the server sends its public key, your SSH client software computes the key hash (the fingerprint) and displays it. At that point, you still have not authenticated yourself, so everything you did, anybody could have done it.

Thus, there is no problem is publishing the key fingerprint because any possible attacker already has it.

Of course, publishing the key fingerprint and using it as a basis for server authentication requires robust publication: an industrious attacker intent on doing Man-in-the-Middle attacks would try to alter the published fingerprint as you see it, so as to induce you into accepting as genuine a fake server key. Thus, if you publish the server's public key on a Web site, make it an HTTPS Web site. (In other words, for this fingerprint, you do not need confidentiality but you need integrity.)


Yes, the fingerprint is merely a hash of the public key, used to authenticate it. An adversary would require the private key to decrypt your messages. Getting the private key from the information available would require:

  1. A hash function which is not preimage-resistant (some might not consider that a real hash function).
  2. RSA is broken

Wikipedia shows public key fingerprints here.

It's a fair question, though, SSH does not say that it is the public key's fingerprint.


You must log in to answer this question.