I'm using msysgit on Windows 7 as well as the PuTTY suite.

I opened Puttygen and clicked the "Generate" button. I moved my cursor around to "generate some randomness". After the key was created, I entered a passphrase for the key and clicked "Save private key". I saved the file as "private.ppk" in the directory c:/Users/Kristen/.ssh.

Then I clicked "save public key" and saved the file as "public.pub" inside c:/Users/Kristen/.ssh.

Then I copied the contents of the field labeled "Public key for pasting into OpenSSH authorized_keys file". I did not copy the contents of the public.pub file, because I know that has extra data that will break the key.

I went to my GitHub account, went to Settings > SSH Keys, and clicked the "Add SSH key" button. I gave they key a title, then pasted in the key I copied from Puttygen and clicked "Add Key". The key was saved successfully.

I opened Pageant and clicked "Add Key". I selected the file "public.ppk" from c:/Users/Kristen/.ssh. I entered the passphrase.

I opened Git bash and typed ssh git@github.com. It asked me if I wanted to add github.com to the list of known hosts. I typed yes. Then I got this error:

Permission denied (publickey).

Then I typed ssh -v git@github.com and got this output:

enter image description here

I saw that it was looking for id_rsa, so I created a directory named id_rsa and placed my keys inside it.

Then I typed ssh git@github.com again, and got this message:

Enter passphrase for key c:/Users/Kristen/.ssh/id_rsa:

I entered the passphrase for my private key but it kept asking again and again.

Then I deleted that folder and changed the name of my private key to id_rsa.ppk, but got the same "Permission denied (publickey)" message.

I went into Control Panel > System > System Properties > Advanced > Environment Variables, and my GIT_SSH variable is set to c:\Program Files (x86)\PuTTY\plink.exe, and I confirmed that Plink does live in that folder.

Not sure what else to try. Suggestions?

1 Answer 1


I saw that it was looking for the private key in a folder called id_rsa.

No, I can assure you, id_rsa would be the name of a private ssh key file, not a directory.

Your keys should be in %HOME%/.ssh, but if you are using plink and pageant (and not openssh), make sure the environment variable GIT_SSH reference plink.exe.
See for instance "How do I set GIT to use Plink.exe".

env var

See this tutorial to generate your keys.

  • Ah, I assumed since id_rsa didn't have an extension it was a directory. Anyway, I've confirmed that the path to Plink in my GIT_SSH variable is correct, and I've updated my question to include that.
    – kmgdev
    Mar 5, 2013 at 16:05
  • @kgrote try and regenerate your keys following nathanj.github.com/gitguide/tour.html#pushing (and publish the new public key)
    – VonC
    Mar 5, 2013 at 16:13
  • Hmm, it works fine when I git push, but not when I use the ssh command. Obviously that doesn't really matter, but it's damned annoying.
    – kmgdev
    Mar 5, 2013 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.