Generating an SSH Key for Github

by Troy Grosfield
February 7th, 2013

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/ (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/
     ssh-rsa AAAB3NaC1ADAQ......Qe2kOOPXrXl

    Copy the output.

  5. Go to github user settings and click on the SSH Keys tab (url something like
  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.
No Comments »

No Comments Yet

Leave a reply

You must be logged in to post a comment.