1

At my work station at the office, I set a new key and push successfully.

But at home, I forgot my password. So I generated a new key and added it

process in the command line

I set a password that I memorized. But when I went to push to Heroku, rather than being asked for the password respective of the public key I was asked for, I was instead prompted for a password to a different key.

heroku password

I also looked at Heroku's documentation on keys but they did not mention how to remove the old keys.

I am also aware of the question Permission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedly but that does not explain why I am not able to switch between keys.

Yes I have created a new key and uploaded it

Juan-Gallardos-MacBook-Pro:.ssh juangallardo$ heroku keys:add heroku_sucks.pub
Uploading SSH public key heroku_sucks.pub... done
Juan-Gallardos-MacBook-Pro:.ssh juangallardo$

But stil got

Cloning into 'cssbuttongallery'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Community
  • 1
  • 1
JGallardo
  • 11,074
  • 10
  • 82
  • 96
  • 1
    `heroku help keys` will show you what you need to do to remove a key - it'll be `heroku keys:remove KEY` – John Beynon Aug 27 '13 at 08:13
  • @JohnBeynon, this is weird. I even cleared all my keys. Then did `heroku keys:add` then selected the key that I knew the password to. But when attempting to clone, I still got prompted to enter a key that I did not remember the password to. – JGallardo Sep 07 '13 at 19:21

1 Answers1

1

Since Heroku's documentation was incomplete I found some guidance from Github. Apparently I was not using my SSH Key https://help.github.com/articles/error-permission-denied-publickey#make-sure-you-have-a-key-and-ssh-is-using-it . Which I found out by running

ssh-add -l

I then added it by running

ssh-add ~/.ssh/[name_of_key]

So you just replace "[name_of_key]" with your filename (modify the path if you need to). And do not include the .pub extension or you will get an WARNING: UNPROTECTED PRIVATE KEY FILE! error.

You will then be prompted for your passphrase

Enter passphrase

And get a confirmation if all goes well

Identity added:
JGallardo
  • 11,074
  • 10
  • 82
  • 96