Add ssh key to gihub

First you need to generate your ssh key as described in this post.

Then add the public key to your github account in the settings page

Then test whether you can use ssh with your github account from your linux terminal:


imela@curtsey ~ $ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '194.50.23.122' to the list of known hosts.
Hi whiscardz! You've successfully authenticated, but GitHub does not provide shell access.

References

Testing your SSH connection

Specify private SSH-key to use when executing shell command with or without Ruby?

Generate ssh keys

Problem

I needed to generate a generic ssh key that I could use on multiple machines as well as on web portals that support ssh keys

Solution

Generate a key that was tired to my email account:


$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Enter a file in which to save the key (/home/you/.ssh/id_rsa): [Press enter]

Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]

Adding your ssh key to your keyring:

Start the ssh-agent in the background and add your private key to the ssh agent. Incase you used a key with a different name other than id_rsa then edit accordingly:


$ eval "$(ssh-agent -s)"
Agent pid 59566

$ ssh-add ~/.ssh/id_rsa

References

Generating a new SSH key and adding it to the ssh-agent

How To Set Up SSH Keys

How to generate an SSH key pair in Linux?

Git on the Server – Generating Your SSH Public Key