What is the purpose of this conversion?
Yeah, that’s nice!! Sometimes we need this conversion, if you have Linux and Windows OS on your PC/Laptop. Consider the scenario, you have servers on your AWS account and you downloaded the key on your Windows machine and now you wanna access the server from your Linux machine.
The key you downloaded on your windows machine should be in .PPK format, that you using in your Putty for accessing remote AWS server.
Here we need to convert the .PPK key to .PEM format. So that you can use the same key to access remote machine.
Please follow the steps pasted below:
Step 1: Copy the .PPK key to your Linux machine.
Step 2: Make sure that putty-tools is installed on your Linux machine.
Step 3: The command line tool “puttygen” is required to convert the private key format.
How to install puttygen on Linux machine?
Step 4: Use the following command:
sudo apt-get install putty-tools
Step 5: Converting PPK file to PEM file
puttygen ppkkey.ppk -O private-openssh -o pemkey.pem
Here “ppkkey.ppk” is the private key which you copied from the Windows machine.
And “pemkey.pem” is the new key in PEM format.
Step 6: Change the permission to 600.
chmod 600 ppkkey.ppk
Step 7: Place the pemkey.pem file in your ~/.ssh directory
Step 8: Another way to use the key:
ssh -i /path/to/pemkey.pem [email protected]
How to enable key based authentication – Putty
It’s time that I had to write a post about this, connecting to Linux server from Windows using Putty via public key. It’s very simple to connect using keys and also it’s highly secure. Putty is the client to connect to Linux based servers from your Windows machine. Here I’m explaining how to generate Key in windows using Putty and how to setup your machine to connect to Linux servers automatically. Read more…
2 thoughts on “How to covert ppk file to pem file – Linux Private Key?”
Good post, thanks for sharing really helpful.