How do I access my SSH public key?

sscirrus picture sscirrus · Sep 30, 2010 · Viewed 1M times · Source

I've just generated my RSA key pair, and I wanted to add that key to GitHub.

I tried cd id_rsa.pub and id_rsa.pub, but no luck. How can I access my SSH public key?

Answer

Mitch Dempsey picture Mitch Dempsey · Sep 30, 2010

cat ~/.ssh/id_rsa.pub or cat ~/.ssh/id_dsa.pub

You can list all the public keys you have by doing:

$ ls ~/.ssh/*.pub