1
votes

Hi I'm trying to clone my project from github repo. I've added Public Key, tested ssh with ssh -T [email protected] 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

4
what is your git clone command? - Kit Ho
git clone [email protected]:username/ProjectName - Headshota

4 Answers

5
votes

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....

5
votes

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.

2
votes

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 [email protected]


1
votes

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.