Skip to the content.

Generating SSH Key for Authentication

Overview

  1. Generate a new SSH Key
  2. Start SSH Agent
  3. Create Config file
  4. Modify Config file
  5. Add SSH key to SSH Agent
  6. Add SSH key to Github Account

Generating a new SSH key

Start SSH Agent

Create SSH Config File

Add SSH Key to SSH Agent

Adding SSH Key to Github

  1. Execute the command below to copy the SSH public key to your clipboard.

     $ pbcopy < ~/.ssh/id_rsa.pub
    
  2. In the upper-right corner of any page, click your profile photo, then click Settings.
    Settings icon in the user bar

  3. In the user settings sidebar, click SSH and GPG keys.
    Authentication keys

  4. Click New SSH key or Add SSH key. SSH Key button

  5. In the “Title” field, add a descriptive label for the new key. For example, if you’re using a personal Mac, you might call this key “Personal MacBook Air”.

  6. Paste your key into the “Key” field.
    The key field

  7. Click Add SSH key.
    The Add key button

  8. If prompted, confirm your GitHub password.
    Sudo mode dialog

Use Keychain Helper