41

Possible Duplicate:
github: newbie problems -> Permission denied (publickey). fatal: The remote end hung up unexpectedly

please see the below command ,

$ git clone git://github.com/{user_name}/{project_name}.git
Initialized empty Git repository in /home/dengx/rorBlog_demo/rorblog/.git/

Changing the files and committing it, so i need to push back to git repository.

$ git push git@github.com/{user_name}/{project_name}.git master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

so, i copy the ssh-key of the repository to my file ~/.ssh/id_rsa.pub, and then push again,

$ git push git@github.com/{user_name}/{project_name}.git master
Agent admitted failure to sign using the key.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Now, what should i do , thanks any helps.

Community
  • 1
  • 1
coolesting
  • 1,451
  • 5
  • 18
  • 22

1 Answers1

35

Googled "Permission denied (publickey). fatal: The remote end hung up unexpectedly", first result an exact SO dupe:

GitHub: Permission denied (publickey). fatal: The remote end hung up unexpectedly which links here in the accepted answer (from the original poster, no less): http://help.github.com/linux-set-up-git/

Community
  • 1
  • 1
johnny
  • 4,024
  • 2
  • 24
  • 38
  • I new a ssh-key in other local repository, and add the new ssh-key to github repository, then try again `ssh -T git@github.com`. it show me this error `Agent admitted failure to sign using the key. Permission denied (publickey). ` – coolesting Aug 16 '11 at 12:56
  • 5
    I solved this problem myself, it needs to add the ssh-key to admin panel of that project , not in account setting. Here is the right link for adding your deploy key, `https://github.com/{user_name}/{project_name}/admin` – coolesting Aug 18 '11 at 03:07
  • @coolesting are these same key used for Account Settings? or generate new – Volatil3 Feb 03 '14 at 12:27
  • You can deploy your public keys to github using url: https://github.com///settings/keys – Shumin Guo Feb 26 '14 at 20:36
  • @johnny : is there any way to remove public key/ ssh and back normal to https port – Nitin Sep 22 '16 at 07:01