简体   繁体   中英

git clone (Permission Denied)

Hi I'm trying to clone my project from github repo. I've added Public Key, tested ssh with ssh -T git@github.com successfully. but when I try to clone one of my projects I get the following message:

Permission denied (publickey).

fatal: The remote end hung up unexpectedly

The ssh key registered with your Github account probably does not match the one currently in use on your system, or was probably changed after registering with Github.

Try this:

cat ~/.ssh/id_rsa.pub

Copy the output of the last command

Go to account settings on Github and add a new SSH key

Then try the clone command.

It could be many things. There are explicit instructions how how to debug this issue at

http://help.github.com/ssh-issues/

You are basically going to have to try to ssh to github with verbose logging, and it should tell you what the issue is. Probably a permissions issue on your public key file....

First, follow the instructions provided by AbhinavChoudhury


$ cat ~/.ssh/id_rsa.pub

Copy the output of the last command

Go to account settings on Github and add a new SSH key


Then use the below command to test the connection:


$ ssh -vT git@github.com


Most likely (besides and incorrect keyfile) you have to set the permissions on your .pem file (i think its to 644) and then use sudo on the git clone command. That's what worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM