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?
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?
If you are using Windows PowerShell, the easiest way is to:
That will copy the key to your clipboard for easy pasting.
So, in my instance, I use ed25519 since RSA is now fairly hackable:
Because I find myself doing this a lot, I created a function and set a simple alias I could remember in my PowerShell profile (learn more about PowerShell profiles here. Just add this to your
Microsoft.PowerShell_profile.ps1
:Then, in a PowerShell console, run
. $profile
to load the functions. Then from now on all you will need to do is runsshkey
, and then paste the key into wherever you need via the clipboard.Open your id_dsa.pub or some_name.pub file with gedit and copy-paste the contents!
Just use:
If you're using windows, the command is:
it should print the key (if you have one). You should copy the entire result. If none is present, then do:
If your .ssh folder does not have any
id_rsa.pub
file, you can create it with the ssh-keygen command.