14

I recently got an e-mail from Github saying that I should review my SSH key:

Please review your keys and ensure you recognize them. If you have any doubts whatsoever, reject the keys and upload new keys.

How do I review my keys with git on ubuntu 11.10?

Shawn
  • 10,931
  • 18
  • 81
  • 126

4 Answers4

20

You can follow the GitHub guide "Reviewing your SSH keys"

To verify your SSH keys you need to find the fingerprint of each key on your computer and compare it to the fingerprint displayed on GitHub.

What’s a Fingerprint?

An SSH key’s fingerprint is a sequence of bytes unique to that key.
Fingerprints are usually encoded into hexadecimal strings and formatted into groups of characters for readability.

We display SSH key fingerprints on GitHub along with the key’s title:

key fingerprint

From there, for Ubuntu, you can refer to "How do I find my RSA key fingerprint on ubuntu 10.04 (hosted by linode)" (-l here means to "list" instead of create).

$ ssh-keygen -E md5 -lf ~/.ssh/id_rsa.pub
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • That GitHub guide is gone. Most similar content appears to be https://help.github.com/en/articles/reviewing-your-ssh-keys – jamieguinan Mar 15 '19 at 14:41
  • @jamieguinan Thank you. I have revised the answer accordingly. – VonC Mar 15 '19 at 16:26
  • What do you think about adding `-E md5` to the example command? Github shows fingerprints in md5 format, but newer `ssh-keygen` now defaults to sha256. – jamieguinan Mar 15 '19 at 16:48
  • @jamieguinan Actually... I would add also -m PEM when generating a new key: https://stackoverflow.com/a/53645530/6309! I will edit the answer per your recommendation in the case of listing the fingerprint. – VonC Mar 15 '19 at 17:07
7

You can also use https://github.com/username.keys (I used my keys as a demo URL).

chx
  • 11,270
  • 7
  • 55
  • 129
5

If you have a bunch of keys to compare with the GitHub fingerprint this line comes in handy:

cd ~/.ssh; for k in *.pub; do ssh-keygen -E md5 -lf $k; done
the
  • 21,007
  • 11
  • 68
  • 101
2

Try to push / pull to one of your own repositories on github. A message will appear that the current key is not authorized. In addition is the SSH fingerprint of the current computer and a link displayed where it is possible to review your keys. Follow the link and mark the SSH key from your computer as approved.

midtiby
  • 14,550
  • 6
  • 34
  • 43