How to convert PuTTY’s private key (.ppk) into OpenSSH’s private key format in Linux?
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: .ppk, Linux, OpenSSH, private key, PuTTY, PuTTYgen, RSA, RSA authentication
Jan 06, 2011
I just wanted to thank you Laszlo for the putty-tools, it helped me a lot.