I know that is possible to convert .ppk under puttygen in Windows, but how to do that on Linux? Is this possible ?

4 Answers 4


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: dnf install putty or yum install putty
  • Gentoo: emerge putty
  • Archlinux: sudo pacman -S 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
  • hi i already have a .pub then it is need to create public key again
    – Amit Bera
    Commented Aug 20, 2014 at 12:19
  • 4
    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. Commented Sep 22, 2014 at 16:46
  • 1
    the solution from @jous is much nicer since you don't need the private key to convert a public key + you don't need to install putty
    – Tobi
    Commented Aug 19, 2015 at 12:55
  • I had to add this key to my ./ssh/config file Host mysite.com Hostname mysite.com IdentityFile ~/.ssh/id_dsa IdentitiesOnly yes
    – vladkras
    Commented Jan 12, 2016 at 16:33
  • Some elliptic curve formats (ECDS etc) are only available in the beta putty tools yet.
    – Daniel W.
    Commented Mar 23, 2016 at 10:27
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

  • 24
    .ppk files are the full key pairs, I don't think the command above or the blog post apply to that. Commented Feb 7, 2013 at 0:27
  • 2
    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
    Commented Jan 7, 2014 at 14:35
  • 2
    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
    Commented Mar 12, 2015 at 3:10
  • 5
    This does not seem to cover private keys, which is why I would want to do the conversion, I already have a public key saved somewhere... Commented Feb 6, 2016 at 9:47
  • Yeah, the ppk files I've seen have had the appropriate markers, and this has worked just fine.
    – tylerl
    Commented Sep 8, 2019 at 21:40

Get the private key:

open the .ppk file in puttygen:

puttygen ~/.ssh/id_dsa.ppk

export as openssh:

Conversions → Export OpenSSH key

Get the public key:

open like before the private key with puttygen, the public key is under public key for pasting into OpenSSH authorized_keys file


I prepared a Docker container to make life simpler:

docker run --rm \
           --volume=/path/to/file.ppk:/tmp/id_dsa.ppk \
           --volume=/path/to/output:/tmp/out/ \


  • /path/to/file.ppk - local path to your ppk file
  • /path/to/output - local path to where the private and public key should be placed
  • 2
    great. thx for the image! however meanwhile its --volume=/path/to/file.ppk:/tmp/id.ppk and not id_dsa.ppk
    – pHiL
    Commented Oct 4, 2016 at 16:38
  • 5
    You may like to add --network none
    – Xorax
    Commented Oct 12, 2020 at 13:55
  • 2
    I get puttygen: error loading '/tmp/id.ppk': PuTTY key format too new
    – Danon
    Commented Sep 20, 2021 at 10:16
  • Thanks! I've forked a new image crowne/putty-tools which solves the PuTTY key format too new error
    – crowne
    Commented Dec 7, 2023 at 14:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .