This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2020-08-20. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Article version: Enterprise Server 2.18

Adding a new SSH key to your GitHub account

To configure your GitHub Enterprise account to use your new (or existing) SSH key, you'll also need to add it to your GitHub Enterprise account.

Before adding a new SSH key to your GitHub Enterprise account, you should have:

After adding a new SSH key to your GitHub Enterprise account, you can reconfigure any local repositories to use SSH. For more information, see "Switching remote URLs from HTTPS to SSH."

Note: DSA keys were deprecated in OpenSSH 7.0. If your operating system uses OpenSSH, you'll need to use an alternate type of key when setting up SSH, such as an RSA key. For instance, if your operating system is macOS Sierra, you can set up SSH using an RSA key.

  1. Copy the SSH key to your clipboard.

    If your SSH key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.

    $ pbcopy < ~/.ssh/id_rsa.pub
    # Copies the contents of the id_rsa.pub file to your clipboard

    Tip: If pbcopy isn't working, you can locate the hidden .ssh folder, open the file in your favorite text editor, and copy it to your clipboard.

  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 Enterprise password.

    Sudo mode dialog

  1. Copy the SSH key to your clipboard.

    If your SSH key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.

    $ clip < ~/.ssh/id_rsa.pub
    # Copies the contents of the id_rsa.pub file to your clipboard

    Tip: If clip isn't working, you can locate the hidden .ssh folder, open the file in your favorite text editor, and copy it to your clipboard.

  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 Enterprise password.

    Sudo mode dialog

  1. Copy the SSH key to your clipboard.

    If your SSH key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.

    $ sudo apt-get install xclip
    # Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`)
    
    $ xclip -sel clip < ~/.ssh/id_rsa.pub
    # Copies the contents of the id_rsa.pub file to your clipboard

    Tip: If xclip isn't working, you can locate the hidden .ssh folder, open the file in your favorite text editor, and copy it to your clipboard.

  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 Enterprise password.

    Sudo mode dialog

Ask a human

Can't find what you're looking for?

Contact us