Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running PuTTY Pageant on Windows, and I used it to generate a private SSH key with a .ppk extension.

Now I want to change the password to that key, so I opened my Git bash terminal, cd'd to my .ssh directory, and typed:

ssh-keygen -f private.ppk -p

It then asks me to enter my old passphrase, but after entering it, it says "Bad passphrase." I'm absolutely certain I'm entering the passphrase correctly.

Does Pageant do some weird encryption with the SSH keys it generates so I can't update the password? The password works fine when unlocking the key within Pageant, and the key itself works fine, too.

share|improve this question

migrated from stackoverflow.com Dec 20 '12 at 17:29

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

1 Answer 1

up vote 5 down vote accepted

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:

  1. Run the puttygen.exe program.
  2. Click on the "Load" button.
  3. Select the private key file that you want to put a passphrase on.
  4. Enter the new desired passphrase in the "Key passphrase" and "Confirm Passphrase" fields.
  5. Click on the "Save private key" button. Overwrite the existing copy of your key.
share|improve this answer
    
Perfect answer. Thank you for being concise and to-the-point. –  kgrote Dec 31 '12 at 21:03

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.