How do I convert a .pem file to .ppk, or from .ppk to .pem, on Windows and Linux?
3 minute read
I want to convert my Amazon Elastic Compute Cloud (Amazon EC2) Privacy Enhanced Mail (.pem) file to a PuTTY Private Key (.ppk) file. Or, I want to convert a .ppk file to a .pem file.
PuTTY doesn't natively support the private key format (.pem) that Amazon EC2 generates. Before you can use PuTTY to connect to your instance, you must convert your private key into a .ppk file. Use the PuTTYgen tool for this conversion.
Windows - install PuTTYgen
Most Windows operating systems have PuTTY installed. If your system doesn't, then download and install PuTTYgen from the SSH website.
Start PuTTYgen. For Actions, choose Load, and then navigate to your .ppk file.
Choose the .ppk file, and then choose Open.
(Optional) For Key passphrase, enter a passphrase. For Confirm passphrase, re-enter your passphrase. Note: Although a passphrase isn't required, it's a best practice to specify one. This is a security measure to protect the private key from unauthorized use. A passphrase makes automation difficult, because users must manually log in to an instance or copy files to an instance.
From the menu at the top of the PuTTY Key Generator, choose Conversions, Export OpenSSH Key. Note: If you didn't enter a passphrase, then you receive a PuTTYgen warning. Choose Yes.
Name the file and add the .pem extension.
Unix or Linux - install PuTTY
Install PuTTY, if it's not already on your system.
The Extra Packages for Enterprise Linux (EPEL) repository contains the PuTTY package. You must activate the EPEL repository before you install PuTTY.