Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 "" 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 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 It asked me if I wanted to add to the list of known hosts. I typed yes. Then I got this error:

Permission denied (publickey).

Then I typed ssh -v 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 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?

share|improve this question

migrated from Mar 6 '13 at 18:34

This question came from our site for professional and enthusiast programmers.

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.

share|improve this answer
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. – kgrote Mar 5 '13 at 16:05
@kgrote try and regenerate your keys following (and publish the new public key) – VonC Mar 5 '13 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. – kgrote Mar 5 '13 at 23:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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