SSH Key Fingerprint

If you have created a SSH key using ssh-keygen and have added the public key in some remote machine or site and you are wondering how you can verify the fingerprint which you are asked to do when you’re connecting via ssh for the first time to the remote machine, then you have come to the right place.

I initially thought that the fingerprint is stored in some file and was searching for it in ~/.ssh/ and /etc/ssh/ directories and I was wrong. You will get it when you run the following on bash:

ssh-keygen -lf /home/<user>/.ssh/id_rsa.pub

Or if you have given out your public key which is in /etc/ssh, then you will get it by running the same command on the public key file there:

ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub

You can also try:

ssh-keygen -l

and it asks for the file in which the key is present and returns with the fingerprint.

Advertisements

One thought on “SSH Key Fingerprint”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s