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 know that is possible to convert .ppk under puttygen in Windows, but how to do that on Linux? Is this possible ?

share|improve this question

2 Answers 2

up vote 104 down vote accepted

Do it with Putty.

  • Linux: with your package manager, install PuTTY (or the more minimal PuTTY-tools):

    • Ubuntu sudo apt-get install putty-tools
    • Debian-like apt-get install putty-tools
    • RPM based yum install putty
    • Gentoo emerge putty
    • etc.
  • OS X: Install Homebrew, then run brew install putty

Place your keys in some directory, e.g. your home folder. Now convert the PPK keys to SSH keypairs:cache search

To generate the private key:

cd ~
puttygen id_dsa.ppk -O private-openssh -o id_dsa

and to generate the public key:

puttygen id_dsa.ppk -O public-openssh -o id_dsa.pub

Move these keys to ~/.ssh and make sure the permissions are set to private for your private key:

mkdir -p ~/.ssh
mv -i ~/id_dsa* ~/.ssh
chmod 600 ~/.ssh/id_dsa
chmod 666 ~/.ssh/id_dsa.pub

If you have already tried to perform a 'git clone' operation you might need to do this also

chmod 666 ~/.ssh/known_hosts
share|improve this answer
thanks @Stanley Williams this save lot of time for me –  Poonam Bhatt Aug 7 '14 at 10:41
hi i already have a .pub then it is need to create public key again –  Amit Bera Aug 20 '14 at 12:19
If you came here looking for how to do it in windows, run "puttygen yourkey.ppk", and then under the Conversions menu choose "Export OpenSSH key" to get the private key. –  Ryan Shillington Sep 22 '14 at 16:46
ssh-keygen -i -f id_dsa_1024_a.pub > id_dsa_1024_a_openssh.pub
  • -i flag is import from other than openssh format
  • -f flag means read from input file

Source: a blogpost at burnz.wordpress.com

share|improve this answer
+1 — no need for any additional software –  mogsie Nov 27 '12 at 9:52
.ppk files are the full key pairs, I don't think the command above or the blog post apply to that. –  Peter Becker Feb 7 '13 at 0:27
I think I meant that it works if you use puttygen's "Save public key" button. ssh-keygen do not understand true .ppk files because they lack those '---- BEGIN SSH2 PUBLIC KEY ----' markers. You can find the public key in the .ppk file between lines "Public-Lines:.." and "Private-Lines:.." though. –  jous Jan 7 '14 at 14:35
This worked for me with a public-key file - puttygen seems to require a private key. it's seems that all it did was rearrange the base-64 part into a single line –  Jasen Mar 12 at 3:10

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.