Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
AAAAB3NzaC1yc2EAAAABJQAAAIBnvvAhyMs4rdlQd4OdajDw4jIPi6vIjrWjt4l4
5C3wHOSxyQQdtSA8XT3K0rSBnNtZRJTb5mfix67qQe3pHCTMSNsYIaBi8xQJHZRa
RxdY+1VtGnSlEma8KO2We9eDNCGiwrRTUzqvTiGCnzU0pF1MXxu3ObISJcpqv+sQ
1GB0cw==
Private-Lines: 8
AAAA..........
Private-MAC: XXXXXXXXX

Now I need to change the passphrase, and reading from the docs it 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?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer

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.

From:

http://superuser.com/questions/522159/unable-to-change-password-for-private-ssh-key

share|improve this answer
    
+1, thanks a lot! It was hard to decide which answer to accept, the other one was just marginally more to my taste. Keep it up! –  janos Jun 28 '13 at 8:45

Your Answer

 
discard

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.