I'm having a similar problem to this: Permission denied (publickey). fatal: The remote end hung up unexpectedly while pushing back to git repository
But I suspect it might be more complicated because I am running vagrant on a mac (mountain lion) and I am having this "Permission Denied" issue that I wasn't having in Snow Leopard.
I set up git on my mac (mountain lion) with ssh key, it works.
I set up vagrant (lucid32 box) and set up a new ssh key (once I ssh'ed into vagrant):
cd ~/.ssh
ssh-keygen -t rsa -C "myemail@mail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/vagrant/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): [just hit enter]
Enter same passphrase again: [just hit enter]
Then I added the ssh key to my github repo (note: was having problems with pbcopy/xclip so I just used vi and copy-pasted)
vagrant@lucid32:~$ cd /vagrant/
vagrant@lucid32:/vagrant$ git push -u origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
So, now I have two ssh keys in my github repo:
- My Mac key (works, can commit to my non-vagrant repo from my mac)
- My vagrant key (does not work, cannot ssh into vagrant and commit my repo from my vagrant box)