Converting a .pem to .ppk format is a matter of one line code. First, you need to have puttygen installed on your system to convert pem to ppk.
Step1: Install puttygen by issuing the following command in terminal.
sudo apt-get install putty-tools
Step2:Make your current directory where you have the .pem file and issue the following commands. Let’s say I have my .pem file in downloads folder
cd /downloads puttygen keyname.pem -o keyname.ppk //keyname is your keys name
That’s it , you are done. You can see the converted .ppk file in the folder.