I'm attempting to deploy my code to heroku with the following command line:
git push heroku master
but get the following error:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
I have already uploaded my public SSH key, but it still comes up with this error.
This problem was messing with me for a few days.
This might help.
1) Find out what keys you have in Heroku now.
2) Build a ~/.ssh/config file:
Edit with this info
Check your .ssh config for heroku. Go to the .ssh folder and open the config file
The 'subl' is for Sublime Text, but you can use whatever editor you wish. Look for the line "IdentityFile" and make sure it has the non public key listed:
not
That did it for me. I'm not sure why mine had the public version in the config file, but it did and it was throwing the error:
Try repairing permissions in Disk Utility (Mac OS X). Helped me
I killed myself for 3 days trying every possible combination to try to get this to work -- I finally tried making a DSA key instead and it worked.
Try DSA instead of RSA if it's not working for you.
(I'm using Ubuntu 11.10, ruby 1.8.7, heroku 2.15.1)
If you want to use "sudo", example:
you should also generate ssh key for your root user.
and it'll work.
if you don't use root user, generate ssh key in your user directory instead.
Sorry if my sentences messed up...
Sequence to follow
When executing second statement it would ask for input, just press Enter(return) three times and a key will be added.