Adding an SSH key to your github.com account for a Linux server is easy. I did notice that it appeared I was doing something incorrectly but the issue was actually with Internet Explorer and once I switched to Firefox everything went smoothly.
- Open GitHub Account Settings: Open github.com in a browser and login. Click “account” in the top right corner.
**NOTE** Make sure to use a browser other than IE. Firefox works just fine but IE will not open the area to add a new SSH key.
- Add New SSH Key: In the left column under “SSH Public Keys” click the “add another public key” link. This will pop down a couple fields to fill in along with an “Add Key” button. Enter a name for your new key which will more than likely be a server name or the name of your development PC. Then below that enter the SSH key that can pull from github. If you need help generating the key you can click the help link on github or use the below info to generate a key for Linux.
- Generate Linux SSH Key: Make sure you are logged in as the user that will sync to github and also in that users home directory. Then follow the below instructions as shown for an example user “web”.
- [web@server ~]$ cd .ssh/
- [web@server .ssh]$ ssh-keygen -t rsa
- Generating public/private rsa key pair.
- Enter file in which to save the key (/home/web/.ssh/id_rsa):
- Enter passphrase (empty for no passphrase):
- Enter same passphrase again:
- Your identification has been saved in /home/web/.ssh/id_rsa.
- Your public key has been saved in /home/web/.ssh/id_rsa.pub.
- The key fingerprint is:
- de:a4:1e:05:ea:48:b6:bc:12:22:47:c6:48:6a:6d:bd firstname.lastname@example.org
The data you need will now be located in the id_rsa.pub file so copy the contents of that file and paste that into the Key field on github.
- Save SSH Key: Click the “Add Key” button which will save the key and allow access to this github account from the server the key was generated on.
That’s it. You can add multiple servers by following the same instructions above. The main point I wanted to make was the fact that Internet Explorer does not like the account page on github.