Activities

September 2014
M T W T F S S
« Aug   Oct »
1234567
891011121314
15161718192021
22232425262728
2930  

Converting putty’s ppk file to SSH2 private keys on Linux

One of the recent challenge was, I need to share server access key to my co-workers for fast switching to servers and don’t wish to share the passwords all the time after the security audit. So I would prefer to share the same key which I used for accessing remote Linux server access from windows desktop.

How do I generate SSH2 private key from my pyttygen .ppk file ?

Solution
1. Install puttygen binary on your Linux machine
2. Convert the Putty private key to ssh2 keys using puttygen command.

1. Installing puttygen package.

Prior to install puttygen pacakge, you may need to ensure that make and gcc compiler and gtk2 libraries are installed on your system.

[root@host28 ~]# yum install make gcc gtk2-devel
[root@host28 installation]# wget http://the.earth.li/~sgtatham/putty/latest/putty-0.63.tar.gz
[root@host28 installation]# tar -zxvf putty-0.63.tar.gz && cd putty-0.63
[root@host28 putty-0.63]#./configure --prefix=/opt/putty/ --exec-prefix=/opt/putty && make && make install

2. Convert the Putty private key to ssh2 keys using puttygen command.

Copy your .ppk file which been used on Windows machine to Linux machine. Here I’m referring that file as “putty_ppy_file.ppk” and Linux private key is desktop_access_key.pem

[root@host28 ssh_test]# /opt/putty/bin/puttygen  putty_ppy_file.ppk  -O private-openssh -o desktop_access_key.pem
[root@host28 ssh_test]# ls
desktop_access_key.pem  putty_ppy_file.ppk

How do I use this private key

[root@host28 ssh_test]# ssh -i ~/.ssh/desktop_access_key.pem 192.168.0.166
Last login: Wed Sep  3 12:56:40 2014 from 192.168.0.28
[root@rc-166 ~]#

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>