I have a private key in Windows, created by puttygen.exe. I used default options to save it, the tool automatically gave it a .ppk extension, and it looks like this:

PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: rsa-key-20130627
Public-Lines: 4
Private-Lines: 8

Now I need to change the passphrase, and according to the docs this seemed simple enough:

puttygen.exe -P key.ppk

But this pops up a window with this error:

PuTTYgen Error: Couldn't load private key (unable to open file)

I also tried to change the passphrase using ssh-keygen that comes with Git Bash:

ssh-keygen.exe -p -f key.ppk

It asks for my old passphrase, but then it gives me the error Bad passphrase. Which is not true, because I can add the key in pageant.exe, and I am not mistyping the passphrase...

Anything else I can try to change or drop the passphrase?

2 Answers 2


puttygen on Windows doesn't seem to accept any command line arguments that I can tell. That error is complaining about not being able to find the -P key I believe. If you run puttygen.exe key.ppk instead that should load the ppk into puttygen and allow you to give it a new passphrase and then re-save your key.


Check this out:

Putty does not store keys in an OpenSSH-compatible format. You need to use the "puttygen" tool to manipulate your private key.

(via this document, via Google):

To change or set a passphrase on an SSH key under PuTTY, do the following:

Run the puttygen.exe program. Click on the "Load" button. Select the private key file that you want to put a passphrase on. Enter the new desired passphrase in the "Key passphrase" and "Confirm Passphrase" fields. Click on the "Save private key" button. Overwrite the existing copy of your key.




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.