Use Git/github under Ubuntu [Error:permission denied (PublicKey)]

Source: Internet
Author: User

1. Background
之前因为误删了文件,导致程序和软件都被删除,损失是心疼的,里面有这好几个月的练习代码,一步一步走来的,就这样没了.为了避免重蹈覆辙,于是准备使用git版本控制.在此记录一下,在配置git时候遇到的一些小问题.
2. Preparatory work

Native System: ubuntu 14.04
The entire configuration process is carried out under the guidance of the official website of Liaoche, because its explanation is more detailed, the language is easy to pass,
Follow the process configuration basically no problem. But because of the different environment and operation, it is inevitable that problems will arise.

3. Problems encountered

In git create warehouse –> initialize –>add add to Staging area –>commit commit to current branch.
The main line is very smooth. The next step is to build the remote repository, where there is no local server,
Instead, use GitHub to use the warehouse hosting services that they provide.
Initially, configure SSH on GitHub and then upload the local repository to GitHub using the command:

There's going to be a problem Error: Permission denied (publickey) here
Literally, it should be the issue of permissions, so the current user is set to Superuser, and then upload, but found that the situation is still encountered. So Baidu; After several searches, it was discovered that the problem was actually detailed in GitHub's help.

    原因是开始生成密钥的时候,我使用的是当前用户,而不是su;    当上传的时候必须使用sudo才可以,但是这两种方式的上传的密钥不是同一个,就会出现错误.

-

解决方法:使用su,重新生成密钥,连接github.
4. Summary

(1) The main point, be sure to look at the official website of the description/help file, which is more effective than on-line search;
(2) Important procedures must remember backup and version control, do not really cry.

Resources:
[1]http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000
[2]https://help.github.com/articles/generating-ssh-keys/
[3]https://help.github.com/articles/error-permission-denied-publickey/
[4]http://git-scm.com/git website, you can try Git commands online.

Use Git/github under Ubuntu [Error:permission denied (PublicKey)]

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.