Question

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
Était-ce utile?

La solution

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:
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top