git add remote library to GitHub tips permission denied (publickey)

Source: Internet
Author: User
Tags ssh using git

I used to do projects using Git, which is basically working directly on the IDE. is simply a push.pull.merge. Recently intends to systematically learn about git, to lay a good foundation for future work. So git was installed under Linux, and some commands were contacted in the local repository. This error occurs when you intend to submit to the remote repository. By collecting data, it is due to the fact that the GitHub account does not have SSH public key information set


Go to GitHub and choose settings, as shown



Open, click Create a new SSH key, as shown in figure



Get the following image, title add a name, I named Id_rsa.pub, I did not try, it should be any name can be



The next step is to enter Cat ~/.ssh/id_rsa.pub in the Linux environment, and if no information is present, the key is not generated, so execute the following command


SSH-KEYGEN-T RSA

All the way to the carriage return ...

Finally, enter "Ssh-t git@github.com" to confirm OK.

Try the output again and you should have it.


Then copy the generated public key to GitHub key and click on Add SSH key to complete

Finally, after executing GIT push-u Origin master under the local git directory, you can submit the remote repository code successfully.


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.