In this tutorial, we will learn How to Convert “.ppk” to “.pem” File Using Command in Ubuntu?
I have downloaded a .ppk file to connect to my server using ssh. As I am a Ubuntu user, I need a key that supports the terminal command. So I decided to convert it to a .pem file. I am sharing the steps to convert PPK to PEM format on the Linux terminal using a putty-gen command-line utility.
Convert .ppk to .pem in Linux
Use the below steps to install required packages and convert ppk to a pem file.
Step 1 – First of all, install the putty tools on your Linux system using below command.
sudo apt-get install putty-tools
Step 2 – Now, convert the ppk file to pem file using puttygen command line tool. Let my filename mytechmint.ppk mytechmint.pem
puttygen mytechmint.ppk -O private-openssh -o mytechmint.pem
Step 3 – Change the .pem file permissions. Set the read-only permissions to the owner of the file, remove any permission to group and others. Otherwise, ssh will refuse this key for use.
chmod 400 mytechmint.pem
Step 4 – Finally, connect to your remote Linux server with ssh using this pem key. Here we are passing ubuntu as username and remote.host as hostname or IP.
ssh -i mytechmint.pem firstname.lastname@example.org