How do I convert a .ppk to .pem, on Windows and Linux?

Need to convert a .ppk putty key? This article can help you with the information.

Download and install the suite of putty tools (putty-64bit-0.78-installer.msi)cif you don’t have it already:

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

  1. Start PuTTYgen. For Actions, choose Load, and then navigate to your .ppk file.
  2. Choose the .ppk file, and then choose Open.
  3. (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.

  1. 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.

    1. Name the file and add the .pem extension.
    2. Choose Save.

    Unix or Linux – install PuTTY

    Download and install PuTTY if you don’t have it already: https://www.putty.org/

    Important: The Extra Packages for Enterprise Linux (EPEL) repository contains the PuTTY package. You must activate the EPEL repository before you install PuTTY.

    To install PuTTY, run one of the following 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
    

    Leave a Comment