The account setup at github was easy and I followed the directions for providing my public key. Checked and double checked.
I then added my repository and followed the following steps (also from github):
$ mkdir stage
$ cd stage
$ git init
$ touch README
$ git add README
$ git commit -m 'first commit'
$ git remote add origin git@github.com:stonean/stage.git
$ git push origin master
I get to the last step and try the push. Ooops:
$ git push origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
error: failed to push to 'git@github.com:stonean/stage.git'
I knew it was a configuration issue, just wasn't sure if it was a git thing or not. After a minute or two of thinking it through, all I needed to do was:
$ cd ~/.ssh
$ ssh-add id_rsa
I then re-tried the push command, and it worked. Cool.

8 comments:
This was helpful - I got stuck at the same point you did, and the ssh-add worked for me - thanks!
Didn't work for me:
$ ssh-add id_rsa
Could not open a connection to your authentication agent.
This worked for me, thanks!
If anyone else gets this message:
Could not open a connection to your authentication agent.
Look here for some good advice:
http://www.cs.indiana.edu/csg/FAQ/Security/openssh.html
Thanks for the additional info, much appreciated.
Another thanks from here. Really helpful.
Thanks for this!
Merci pour ceci!
i cant solve it, i'm new in Mac, would you see following
macmini:cake-test macmini$ git push origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
macmini:cake-test macmini$ cd ~/.ssh
macmini:.ssh macmini$ ssh-add id_rsa
id_rsa: No such file or directory
Post a Comment