15
heroku create
Creating floating-planet-1824......................... done, stack is bamboo-mri-1.9.2
http://floating-planet-1824.heroku.com/ | git@heroku.com:floating-planet-1824.git

git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of known hosts.
Agent admitted failure to sign using the key.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

I generated ssh keys ok.

Rebooting didn't help.

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497

5 Answers5

29

It turned out that

heroku keys:add ~/.ssh/id_rsa.pub

worked.

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
20

this is how i solved mine

$ heroku keys:clear
Removing all SSH keys... done
$ heroku login

after clearing all previous ssh. heroku login's uploads back my ssh public key and i can happily git push heroku master back

Aizzat Suhardi
  • 753
  • 11
  • 19
15

Assuming you already have a public and a private key to use in your ~/.ssh folder, there might be two different scenarios:

  • You didn't upload your public key to Heroku's remote server. Solution, execute: heroku keys:add ~/.ssh/your_public_key
  • Or you did, but you don't have your identities loaded into your SSH authentication agent. Solution, execute:

    ssh-add -K ~/.ssh/your_private_key # OSX

    ssh-add -k ~/.ssh/your_private_key # Ubuntu

and enter your passphrase, so you can use your private key.

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
Luis Ortega Araneda
  • 865
  • 1
  • 12
  • 26
5

The problem which i face was setting the ssh environment variable.

SSH_AUTH_SOCK=0

heroku keys

will show the keys, remove and then login, it will create one for you and add to your app. Or you can create your rsa key with your email and then use it using

heroku keys:add /path

Generate key using ssh-keygen -t rsa -C "your_email@youremail.com"

amitchhajer
  • 12,492
  • 6
  • 40
  • 53
0

In case others are facing the same problem: using standalone toolbelt on fedora 16-17 with rmv 1.17.3 and system ruby 1.9.3p392, just clearing heroku keys and credentials was not sufficient, and I tested that the issue was not with my ssh keychain. If anyone has faced similar issues, and is more familiar with the heroku toolbelt, I posted a new issue here.

egbutter
  • 810
  • 11
  • 21