How to Convert PEM to PPK with PuTTY

Connecting to SSH can indeed use a PEM file instead of a password. However, there will be obstacles if the user uses the PuTTY program to access SSH, because the tool does not accept PEM files, and prefers PPK.

The difference is quite simple, PEM is the public key, while PPK is the private key. And to change it is also very easy, because PuTTY itself has provided an additional tool called PuTTY Key Generator (PuTTYGen) to generate public/private keys or convert key files.

For example when you have just created a new instance or VPS in Amazon Web Services, there must only be a PEM file to connect to that instance. Now so that you can access it via PuTTY, it takes a few steps to change the key file format.

Converting from .pem to .ppk Via PuTTYGen on Windows

  1. First download the PuTTY Gen file for Windows.

  2. Open the PuTTY Gen program.

  3. Click menu conversion > Import Key.

  4. After that select the PEM file you have.

  5. When the PEM file is loaded, click the button Save Private Key.

    Converting PEM Key to PPK

  6. Give a new name for the PPK file.

Now the file with the PPK format has been successfully created and is ready to be used as a file auth key to connect to SSH with the PuTTY program. It’s a good idea to save both files for security.

Also read: How to Transfer Files Via SSH with SCP

Converting on Linux

If the above method is done through Windows, you can also convert the PEM format to PPK via Linux. This can be done more practically with the help of the terminal. And the method below is applied to the Ubuntu OS.

First install PuTTY Tools with the following command:

sudo apt-get update
sudo apt-get install putty-tools -y

After that is the conversion process. Make sure the PEM file is provided, and below is an example command to convert it:

sudo puttygen KEY.pem -o KEY.ppk -O private

Please change KEY.pem with the directory or location of the PEM file, and later the results of the PPK file will be available in the directory home user currently named KEY.ppk. If there are other problems or questions, please comment.

Hopefully useful and good luck