Skip to content

Instantly share code, notes, and snippets.

@yosemitebandit
Created March 7, 2012 18:27
Show Gist options
  • Star 41 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save yosemitebandit/1994947 to your computer and use it in GitHub Desktop.
Save yosemitebandit/1994947 to your computer and use it in GitHub Desktop.
view your ssh public key's fingerprint; compare this to what Github has listed in the ssh key audit
$ ssh-keygen -l -f /path/to/keys/id_rsa.pub
2048 aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66:77:88:99 id_rsa.pub (RSA)
@bcackerman
Copy link

"no such file or directory" error. What directory should I be in?

@bcackerman
Copy link

ah cd ~/.ssh

@yosemitebandit
Copy link
Author

yup, it'll probably be ~/.ssh

edited the gist to be a little more clear.

@g2p
Copy link

g2p commented Mar 7, 2012

ssh-keygen -lv # displays pretty ASCIIart
ssh-keygen -B # displays easy to memorize gobbledigook

@sujee
Copy link

sujee commented Mar 7, 2012

thank you!
wish github had this instruction on the verify ssh keys page (https://github.com/settings/ssh)

@HennyN
Copy link

HennyN commented Mar 8, 2012

@sujee e.g.
ssh-keygen -l -f ~/.ssh/id_rsa.pub

@dkoudlo
Copy link

dkoudlo commented Feb 12, 2014

nice one +1

@jamesp9
Copy link

jamesp9 commented Apr 10, 2016

With newer versions of ssh
ssh-keygen -l -E md5 -f ~/.ssh/my-github-key.pub

@aioue
Copy link

aioue commented Jul 22, 2016

Thanks @jamesp9

@swift0701
Copy link

👍 @jamesp9

@medington
Copy link

👍 @jamesp9

@tswast
Copy link

tswast commented Nov 3, 2016

If you are using something like a Yubikey, where there isn't necessarily a file to check, the ssh-add command takes an argument to change the fingerprint algorithm.

This outputs fingerprints in the format that GitHub displays:

ssh-add -l -E md5

@Ian-T-Price
Copy link

@chenlei0x
Copy link

thanks @jamesp9

@johnhamm
Copy link

@m0freak
Copy link

m0freak commented Apr 15, 2020

On MacOS I used the following to get the fingerprint as shown in github

> ssh-keygen -l -E md5 -f id_ed25519.pub                                                                                                                                                                          ⏎
256 MD5:cf:d6:c5:8a:69:30:29:99:19:b9:77:7b:d5:60:83:8b m0freak (ED25519)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment