By Manny Fernandez

May 17, 2020

Converting a PPK file to a PEM file

Converting a PPK file to a PEM file

Have you ever had someone deploy a device in AWS and they chose the .PPK option to save the key.  Then you need to retrieve the administrator password but you require a .PEM file instead?  Here is a quick way to do it.  I run homebrew on my MacBook.  If you run macOS X and you are not running homebrew, check out this article.  I updated the article to show the reverse as well.

Install PuTTY

The first thing you will need to do is install putty.  If you are running Homebrew run the following command.

brew install putty

2020-05-17_00-26-23.png

If you are running Linux, then you can use

You can use either yum or apt depending on your distro.

yum install putty or apt-get install putty

2020-05-17_07-32-37

Now Convert the PPK to PEM

puttygen monkey.ppk -O private-openssh -o monkey.pem

2020-05-17_00-29-40.png

Getting the Password in AWS

Although this is more than the PPK to PEM, I decided to update the article to show the process of using said .PEM file to retrieve the password

Screen Shot 2020-05-17 at 8.07.14 AM

By right clicking on the instance, you can click Get Windows Password

2020-05-17_08-01-19

I blocked out the Key Name but the key name would be displayed.  It will then ask you for your .pem file.

2020-05-17_08-03-20

Once you enter the .pem file and choose Decrypt Password you should see your password.

Going the Other Way (PEM to PPK)

If you need it the other way “pem to ppk” you can use the following command:

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

Hope this helps

 

EJBCA Internal CA: Deploy a Private PKI for Your Local Servers with Docker

EJBCA Internal CA: Deploy a Private PKI for Your Local Servers with Docker

Deploy an EJBCA internal CA in Docker with MariaDB, build a two-tier Root and Issuing CA, and issue trusted TLS certificates to local servers.

Read More
FortiGate IKEv2 Certificate Pinning: Machine Certificate Plus EAP-MSCHAPv2 Remote Access VPN

FortiGate IKEv2 Certificate Pinning: Machine Certificate Plus EAP-MSCHAPv2 Remote Access VPN

Set up FortiGate IKEv2 certificate pinning: require a machine certificate from your own CA before EAP-MSCHAPv2 login, with OpenSSL and CRL.

Read More
eMudhra Certificate Compromise: What Broke and How to Clean Up Your Trust Stores

eMudhra Certificate Compromise: What Broke and How to Clean Up Your Trust Stores

The eMudhra certificate compromise explained: what broke, which clients are still exposed, and how to patch Linux, runtimes, endpoints and FortiGate.

Read More