I have generated SSH keys for a new server installation according to the procedure outlined here. However, when I copy the contents of id_rsa.pub
to my keys list on
I know this is question is a cpl years old now, but if someone in 2018 encounter this:
then below is a no-brainer:
my problem was I tried to copy the private key
id_rsa
instead of public key content
id_rsa.pub
as my SSH gitlab repository key, so after you:
ssh-keygen -t rsa -C "your@email.com" -b 4096
please remember about the .pub file extension to copy from:
pbcopy < ~/.ssh/id_rsa.pub
xclip -sel clip < ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa.pub | clip
this makes perfect sense, because you should always only share your public key, not the private one :)
Recommended by GitHub
SSH-KEY
:I worked with xclip
to copy the id_rsa.pub
key, like so:
xclip
sudo apt-get install xclip
xclip
xclip -sel clip < ~/.ssh/id_rsa.pub
Good Luck.
To Copy the entire content of id_rsa.pub to clipboard:
Run > pbcopy ~/.ssh/id_rsa.pub
If you are using bash for windows as your terminal and you are copying via shift + highlighting + ctrl-c, then this solution might work for you:
It's common issue we face while generating the key. While the SSH generating, we will get two diff files one is id_rsa and id_rsa.pub. here the file with pub extension is the public key holder file. You must copy the content from this file and add to the Github.
NOTES: 1. public key file content starts with 'SSH-RSA' 2. end with your Github email id. ex: if you registered Github with @gmail.com then the pub file has the specified email id at the last
I try several ways, but none of them helps(my os is ubuntu). Then I thought if I can print the content of ~/.ssh/id_rsa.pub by using command "more".
I sorry than I have no reputation to post images! when i have, i will post it!
Here is a url where you can see the image:
I copied the content from the command line, and it WORKED!!!