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're on Windows use the following, select all, and copy from a Notepad window:
If you're on OS X, use:
Use:
Then copy the entire file without any spaces. Click your icon at the top right of the GitHub page, go to settings, and add ssh.
Paste the copy into the space. It may prompt for your GitHub password. Enter it. Save.
cat ~/.ssh/id_rsa.pub
orcat ~/.ssh/id_dsa.pub
You can list all the public keys you have by doing:
$ ls ~/.ssh/*.pub
Copy the key to your clipboard.
And you can paste it wherever you need.
To get a better idea of the whole process, check this: Generating SSH Keys.
On a Mac, you can do this to copy it to your clipboard (like
cmd + c
shortcut)cat ~/Desktop/ded.html | pbcopy
pbcopy < ~/.ssh/id_rsa.pub
and to paste
pbpaste > ~Documents/id_rsa.txt
or, use
cmd + v
shorcut to paste it somewhere else.~/.ssh
is the same path as/Users/macbook-username/.ssh
You can use Print work directory:
pwd
command on terminal to get the path to your current directory.In UBUNTU +18.04
And After that Just Copy And Paste
or