2

I have been trying to clone a project on Heroku.

I have already checked to see that my key (id_rsa.pub) has been added to Heroku via heroku keys:add and that it shows up correctly under heroku keys:status

However, when I do git clone, I get Permission denied (public key). This leads me to believe that my ssh settings are incorrect. Note, I am working on a Ubuntu machine.

To debug this even further, I tried to clone a github repo. Which confirming my belief, worked when using https but not ssh (same error).

My question:

How do I determine which private key git is trying to use to perform the cloning operation.

Additionally, I have tried adding a config file to my .ssh folder with the contents:

Host heroku.com
Hostname heroku.com
IdentityFile ~/.ssh/id_rsa
  • Ubuntu should use `id_rsa` by default. Do the fingerprints match? Is `id_rsa` the only key you have in there, or do you also have an `id_dsa`? – Thomas Kelley Oct 05 '13 at 01:01

1 Answers1

0

Note that if you are using an ssh config file, you should:

  • not named it like the Hostname (Host heroku, for instance, is enough)
  • add the User (git)

The idea behind a config spec is to:

  • manage multiple heroku accounts,
  • but also to have shorter ssh url.
    (Really no need to repeat git@... in front of each ssh url: the user is always 'git' here).

Your config file should be:

Host heroku
Hostname heroku.com
User git
IdentityFile ~/.ssh/id_rsa

Your ssh url should then be:

ssh://heroku:appname.git
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250