Heroku Upload – Permission Denied

I ran into a bit of trouble uploading an app to heroku for the first time, I was unable to authenticate.

root@chris-VirtualBox:~/site# git push heroku master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

This turned out to be an issue with my public key, in order to fix it simply create a new one:

root@chris-VirtualBox:~/site# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
...

Re-upload it:

root@chris-VirtualBox:~/site# heroku keys:add /root/.ssh/id_rsa.pub
Uploading ssh public key /root/.ssh/id_rsa.pub

And finally re-push everything:

root@chris-VirtualBox:~/site# git push heroku master
Enter passphrase for key '/root/.ssh/id_rsa': 
Counting objects: 579, done.
Compressing objects: 100% (513/513), done.
Writing objects: 100% (579/579), 6.09 MiB | 83 KiB/s, done.
Total 579 (delta 101), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rails app detected

This Heroku page actually provides quite a bit of info if you’re still having problems: http://devcenter.heroku.com/articles/rails3


Posted

in

,

by

Comments

11 responses to “Heroku Upload – Permission Denied”

  1.  Avatar
    Anonymous

    thanks!

    Like

  2.  Avatar
    Anonymous

    Thanks man!

    Like

  3. Robert Avatar
    Robert

    Great – thank you!

    Like

  4. Chris Avatar
    Chris

    Solved my problem, thanks!

    Like

  5. tom Avatar
    tom

    You save my day… night! Thanks so much.

    Like

  6. theacadian Avatar

    This post helped me.. thanks..

    Like

  7. Григорий Кислин Avatar

    For Windows users it may means: git client coudn’t find your keys.
    Check keys in c:UsersUserName.ssh and environment variable HOME=c:UsersUserName

    Like

  8. kirdape Avatar

    Григорий Кислин you saved my day.

    Thanks a lot!

    Like

  9.  Avatar
    Anonymous

    Григорий Кислин You are my hero, thanx! :-]

    Like

  10. Mick Stevens Avatar

    Thank you so, so much for this. Many hours of Googling to no avail, but your clear & concise instructions solved it for me. Many, many thanks, now I can FINALLY start playing with Heroku (hopefully)!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

%d bloggers like this: