How to convert PuTTY’s private key (.ppk) into OpenSSH’s private key format in Linux?

Posted on April 3, 2009 by 4 comments

If you want to use your PuTTY generated private key (.ppk) in Linux with not only PuTTY, but other SSH or SFTP client (Terminal, Nautilus, GFTP, etc), you have to convert it to OpenSSH’s private key format, because PuTTY private key format (.ppk) is not compatible with OpenSSH.

First, install “putty-tools” package, if you did not install it yet, because it includes PuTTYgen. You need PuTTYgen to convert the private key.

apt-get install putty-tools

Now, convert your PuTTY private key(.ppk) to OpenSSH’s key format:

puttygen /path/to/putty-privatekey.ppk -O private-openssh -o /path/to/openssh-key

If you use RSA authentication, like me, your OpenSSH private key file name and location/path/to/openssh-key) is the following:

/home/user/.ssh/id_rsa

Note: “user” is your user name.

PuTTY public key format is OK. Open the PuTTY public key in a text editor and copy the file content simply to OpenSSH public key file /path/to/openssh-key.pub

If you use RSA authentication, like me, your OpenSSH public key file name and location (/path/to/openssh-key.pub) is the following:

/home/user/.ssh/id_rsa.pub

Note: “user” is your user name.

Last, but not least set the correct permission to your private key file (chmod 600).

Tags: , , , , , , ,

4 Responses to “How to convert PuTTY’s private key (.ppk) into OpenSSH’s private key format in Linux?”

  1. Samboom71 Jan 06, 2011 #

    I just wanted to thank you Laszlo for the putty-tools, it helped me a lot.

  2. Visko Sep 07, 2011 #

    Szia!

    Thank you for the post, it works like charm :) .

    Üdv:
    Visko

  3. Hari Dec 14, 2012 #

    How can I preserve comment while exporting to openssh?

    Thanks in advance.

Trackbacks/Pingbacks

  1. 5 cose che non sapevo « Linux StickIt - December 13, 2011

    [...] UbuntuForum ElectricToolBox Forum Sabayon Lmonarl Wiki Arch Like this:LikeBe the first to like this [...]

by Transposh - translation plugin for wordpress

Categories


Visitor Map

Recent Readers