0
votes

I have very little knowledge about SSH etc. I was trying to add new SSH key on Github. For this I followed this procedure:

On Terminal

work@Nirvair:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/work/.ssh/id_rsa): 
Created directory '/home/work/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/work/.ssh/id_rsa.
Your public key has been saved in /home/work/.ssh/id_rsa.pub.

Then there was key fingerprint and key's randomart image.

On Browser

I opened:

Github >> Settings >> SSH and GPG keys >> New SSH key

It asked for Title and Key. I gave some title and then I copied my key id_rsa.pub there. It gave an error:

Key is invalid. It must begin with 'ssh-ed25519', 'ssh-rsa', 'ssh-dss', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', or 'ecdsa-sha2-nistp521'. Check that you're copying the public half of the key

I have no idea how to proceed further. Please tell me where I am wrong or direct me to a good tutorial.

OS details: Ubuntu 14.04.5

Thanks!

PS: I tried to read about "key fingerprint" and "key's randomart image" over the internet but everything went over my head

1

1 Answers

3
votes

Are you sure you perfectly copied your public key?

Execute

cat /home/work/.ssh/id_rsa.pub

and copy everything to your clipboard.

You can also try with xclip:

xclip -sel clip < /home/work/.ssh/id_rsa.pub