TroyGrosfield.com TroyGrosfield.com

Headline

Generating an SSH Key for Github

Author
by Troy Grosfield
Date
February 7th, 2013
Category
Developer
Story

These are the steps to generate a new ssh key for Github:

  1. Open terminal and run the following command:
    $ ssh-keygen -t rsa

    you will be prompted to for the location to save the key:

    Enter file in which to save the key (/Users/USERNAME/.ssh/id_rsa): /Users/USERNAME/.ssh/your_key_name
  2. Two key will have been generated at the path you defined:
    1. /Users/USERNAME/.ssh/your_key_name (private key)
    2. /Users/USERNAME/.ssh/your_key_name.pub (public key)
  3. Add they key to your keychain:
     $ ssh-add /Users/USERNAME/.ssh/your_key_name
     Identity added: your_key_name (your_key_name)
  4. Run the following command to get your ssh key for github:
     $ cat /Users/USERNAME/.ssh/your_key_name.pub
     ssh-rsa AAAB3NaC1ADAQ......Qe2kOOPXrXl some.email@example.com

    Copy the output.

  5. Go to github user settings and click on the SSH Keys tab (url something like github.com/settings/ssh).
  6. Click “Add SSH Key” button to generate a new SSH key.
  7. You will be prompted to enter a title (anything you want) and a key.  The key is the output you copied in step 4. Paste that in and your ssh key will be generated.
Tags
Comments
No Comments »

No Comments Yet

Leave a reply