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

Posted on April 3, 2009 by Laszlo1 comment

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: , , , , , , ,

Related Posts

  1. How to convert Putty’s private key (.ppk) into OpenSSH’s private key format in Windows?
  2. PuTTY connection error in Linux, Debian Lenny (solved)
  3. Connecting to a remote machine via SSH
  4. Webbrowsing through a remote machine using SSH connection
  5. How to setup a restricted OpenSSH sftp server?

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

Subscribe to this comment thread trough RSS
  1. Samboom71
    Jan 06, 2011
    Reply

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



Leave a Reply

Additional comments powered by BackType


Visitor Map

Recent Readers