Page 1 of 1

Convert putty .ppk key to OpenSSH format

Posted: Mon May 28, 2007 11:02 pm
by ^rooker
[PROBLEM]
I had several SSH keys in PuTTY's internal format ".ppk" and wanted to use them with OpenSSH.

[SOLUTION]
Since I'm using GNU/Linux (K)ubuntu, I did an "apt-get install putty".
Now you have "puttygen" and can do this:

Code: Select all

puttygen mykey.ppk -O private-openssh -o mykey.key
(For Windows: You can probably use "puttygen" application to export it in the GUI)

Note:
If you run "puttygen --help" you can see other options like "public-openssh", etc...

Using the public-key in .ppk for SSH

Posted: Mon May 28, 2007 11:06 pm
by ^rooker
In case you simply need to add someone's public key to your "~/.ssh/authorized_hosts" file, but don't have or don't want to use "puttygen", just open it in a text editor.

It will start with something like this:
PuTTY-User-Key-File-2: ssh-rsa
Encryption: aes256-cbc
Comment: My beloved key
Public-Lines: 4
Copy paste the lines following after that until "Private-Lines: x" - copy/paste them to your authorized_keys file and add "ssh-rsa" (or ssh-dsa, or whatever it says in line 1 of your Putty .ppk keyfile).