0% found this document useful (0 votes)
45 views

Adding A New SSH Key To Your GitHub Account - GitHub Docs

The document explains how to add a new SSH key to a GitHub account. It involves generating an SSH key, copying the public key to the clipboard, navigating to the SSH keys settings page on GitHub, pasting the public key, and confirming to add the key. Adding the new SSH key allows securely connecting a local repository to GitHub without using a password.

Uploaded by

aristidezz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Adding A New SSH Key To Your GitHub Account - GitHub Docs

The document explains how to add a new SSH key to a GitHub account. It involves generating an SSH key, copying the public key to the clipboard, navigating to the SSH keys settings page on GitHub, pasting the public key, and confirming to add the key. Adding the new SSH key allows securely connecting a local repository to GitHub without using a password.

Uploaded by

aristidezz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

9/29/2020 Adding a new SSH key to your GitHub account - GitHub Docs

Article version: Free, Pro, and Team

GitHub.com / Authentication / Connecting to GitHub with SSH /


Adding a new SSH key to your GitHub account

Adding a new SSH key to your GitHub


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

Mac Windows Linux

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

Checked for existing SSH keys


Generated a new SSH key and added it to the ssh-agent

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

Note: DSA keys (SSH-DSS) are no longer supported. Existing keys will continue to function, but you
cannot add new DSA keys to your GitHub account.

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

$ xclip -sel clip < ~/.ssh/id_rsa.pub


# Copies the contents of the id_rsa.pub file to your clipboard

https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account 1/4
9/29/2020 Adding a new SSH key to your GitHub account - GitHub Docs

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.

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

4 Click New SSH key or Add SSH key.

https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account 2/4
9/29/2020 Adding a new SSH key to your GitHub account - GitHub Docs

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.

7 Click Add SSH key.

8 If prompted, confirm your GitHub password.

https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account 3/4
9/29/2020 Adding a new SSH key to your GitHub account - GitHub Docs

Further reading
"Authorizing an SSH key for use with SAML single sign-on"

Did this doc help you?

https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account 4/4

You might also like