How to convert PPK to PEM and PEM to PPK using terminal in Unix or Linux ?

Step 1 – First, install Putty or Putty tools on your system, by running one of these below commands depends on your distribution :-

For Dpkg-based distributions (Ubuntu)

$ sudo apt-get install putty-tools

For RPM-based distributions (CentOS, Fedora etc)

$ sudo yum install putty

Step 2 – Run Puttygen command to convert .ppk file to .pem file :-

$ sudo puttygen xyz.ppk -O private-openssh -o xyz.pem

or

Step 2 – Run Puttygen command to convert .pem file to .ppk file :-

$ sudo puttygen xyz.pem -o xyz.ppk -O private

Step 3 – Most of the times your server refuse your converted key, due to having bad permission(s) on it. So, add right permission to the .pem or .ppk file with the below command :-

$ sudo chmod 400 xyz.pem or xyz.ppk

You’re done. Now you can connect your linux or unix server with the converted .pem or .ppk key via ssh.

Leave a Reply

avatar