How to Convert a Putty PPK to a Linux private and public key pair

To convert a ppk file to something ssh can use.

 

1) Install putty tools.

RHEL/CentOS/ScientificLinux:  

Install a putty RPM from either RPMForge or nux-dextop repositories.

To install from Nux Dextop Repository

# Install Nux Dextop Repo to RHEL 6/CentOS 6/ScientificLinux 6 #
yum -y install epel-release && rpm -Uvh http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-2.el6.nux.noarch.rpm

# Install Nux Dextop Repo to RHEL 7/CentOS 7/ScientificLinux 7 #
yum -y install epel-release && rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

 

Then install Putty

yum -y install putty

Debian / Ubuntu: 

apt-get install putty-tools

2) Run the following pair of command.

puttygen keyfile.ppk -o id_rsa.pub -O public-openssh
puttygen keyfile.ppk -o id_rsa -O private-openssh
 

 

Where "keyfile.ppk" is the key file to convert, "id_rsa.pub" is the public key file, and "id_rsa" is the private key file. PuTTY stores both the private and public keys in the .ppk file, which is why you use the same file to convert both keys. You can now use you new keys pairs with OpenSSH.