Add SSH keys to your github account

Source: Internet
Author: User

 add SSH keys to your github account2012-05-26 00:05 34279 People read Comments (6) favorite reports SSH text editing Gitvim tools up

When synchronizing a code base on GitHub from GitHub using the git clone command, if you use SSH links (such as my own Beagleos project: [email protected]:D amondeng/beagleos.git), and your SSH Key is not added to the GitHub account settings, the system will report the following error:

Permission denied (PublicKey).

Fatal:the remote end hung up unexpectedly

You will need to create an SSH key locally and then add the generated SSH key file content to your GitHub account.

The way to create SSH keys is simple, and you can do this by following these commands:

Ssh-keygen

Then the system prompts for information such as file save location, three consecutive hit enter, the generated SSH key file saved in the ~/.ssh/id_rsa.pub

Then open the file with the text Editing tool, I use VIM, so the command is:

Vim ~/.ssh/id_rsa.pub

Then copy the content in the. ssh/id_rsa.pub file and paste it into the Add SSH key interface in GitHub account management.

To open the Add SSH key interface in GitHub account management, follow these steps:

1. Login to GitHub

2. Click the Accounting settings icon in the top right

3. Select SSH Key

4. Click Add SSH Key

In the interface that appears, fill in the name of the SSH key, fill in a name you like, and then paste the contents of the ~/.ssh/id_rsa.pub file into the key column, click on the "Add Key" button.

Add a process github will prompt you to enter your GitHub password once

After adding it, execute git clone again to successfully clone the code base on GitHub.

Add SSH keys to your github account

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.