Daniel shows you how to
convert a private key
to and from .ppk and .pem formats

danield_convert_pem_ppk

How do I convert my Amazon Elastic Compute Cloud (Amazon EC2) Privacy Enhanced Mail (.pem) file to a PuTTY Private Key (.ppk) file? Or, convert a .ppk file to a .pem file?

PuTTY does not natively support the private key format (.pem) generated by Amazon EC2. You must convert your private key into a .ppk file before you can connect to your instance using PuTTY. You can use the PuTTYgen tool for this conversion. This tool is available for both Windows and Unix operating system users to convert keys.

Windows - install PuTTYgen

Most Windows operating systems have PuTTY installed. If your system doesn't, download and install PuTTYgen.

Windows - convert a .pem file to a .ppk file

Start PuTTYgen, and then convert the .pem file to a .ppk file. For detailed steps, see Converting Your Private Key Using PuTTYgen.

Windows - convert a .ppk file to a .pem file

  1. Start PuTTYgen. Under Actions, choose Load, and then navigate to your .ppk file.
  2. Choose the .ppk file, and then choose Open.
  3. Clear the Key passphrase and a Confirm passphrase fields.
    Note: The passphrase is used to encrypt the key and is an extra layer of protection. If your private key is discovered, it can't be used, because the passphrase is required to log in. Using a passphrase makes automation difficult, because human intervention is needed to log in to an instance, or copy files to an instance.
  4. Choose Conversions from the menu at the top of the PuTTY Key Generator, and then choose Export OpenSSH Key.
  5. For the PuTTYgen warning Are you sure you want to save this key without a passphrase to protect it?, choose Yes.
  6. Name the file and add the .pem extension.

Unix or Linux - install PuTTY

Install PuTTY, if it's not already on your system, by running one of these commands:

RPM-based

$ sudo yum install putty

Dpkg-based

$sudo apt-get install putty-tools

Unix or Linux - convert a .pem file to a .ppk file

On the instance shell, run the puttygen command to convert your .pem file to a .ppk file:

$ sudo puttygen pemKey.pem -o ppkKey.ppk -O private

Unix or Linux - convert a .ppk file to a .pem file

Run the puttygen command to convert a .ppk file into a .pem file:

$ sudo puttygen ppkkey.ppk -O private-openssh -o pemkey.pem

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2018-06-01

Updated: 2019-02-22