Contact Us | +1 888 239-0733 (Toll free US/CA) Mon-Fri: 7:30am to 4:30pm (PST)

How do I Convert a SSH Private Key .ppk or .pem Format

Est. Reading: 2 minutes
Updated: April 4, 2024

To convert an SSH private key between .ppk (PuTTY Private Key) and .pem (PEM - Privacy Enhanced Mail) formats, you typically use different tools based on the direction of the conversion. Below are the steps for both conversions:

.pem to .ppk Conversion

To convert a .pem file to a .ppk format, you need to use PuTTYgen, a key generator tool for PuTTY. PuTTYgen can convert keys into various formats. Here's how you do it:

  1. Open PuTTYgen: If you don't have PuTTYgen, you'll need to download and install PuTTY, which includes PuTTYgen.
  2. Load the .pem File: Start PuTTYgen, then click "Load". By default, PuTTYgen only shows files with the extension .ppk, so you must select "All Files (.)" from the drop-down menu to see your .pem file. Select your .pem file.
  3. Enter the Passphrase (if applicable): If a passphrase protects your .pem file, enter it when prompted.
  4. Save the Private Key in .ppk Format: Once the key is loaded, click on "Save private key." You may be warned about saving the key without a passphrase. Based on your security requirements, choose whether or not to heed this warning. Save the file with a .ppk extension.

.ppk to .pem Conversion

To convert a .ppk file to a .pem format, you can use PuTTYgen for Windows or the putty-tools package in Linux.

Windows

  1. Open PuTTYgen and load your .ppk file by clicking "Load" and selecting the .ppk file.
  2. Once loaded, go to "Conversions" in the menu and select "Export OpenSSH key." If your .ppk file has a passphrase, you'll need to enter it.
  3. Save the Key: Name your file and save it with a .pem extension.

Linux (Using putty-tools)

  1. Install putty-tools: If not already installed, you can typically install it using your distribution's package manager. For Debian-based systems, you would use: sudo apt-get install putty-tools.
  2. Convert the Key: Use the command puttygen yourkey.ppk -O private-openssh -o yourkey.pem, replacing yourkey.ppk with your .ppk file name and yourkey.pem with the desired output file name.
  3. Set Correct Permissions: For your '.pem' file to be recognized as secure by SSH, it's important to set the correct permissions. You can do this with the command 'chmod 600 yourkey.pem'.

This should cover the basic process of converting between .ppk and .pem formats. Remember, the security of your private key is paramount, so ensure it's always kept secure and never shared.

Ryan Parker

Ryan has been a standout in digital marketing since 2010. He's the go-to person for getting businesses noticed online, with over 300 projects under his belt—these range from helping local business owners to big online stores. As the Head of Digital Marketing at Webzstore Solutions, Ryan knows all the tricks to make companies shine on the internet. He's excellent at using the latest tech and smart strategies to get results. Ryan is all about making businesses grow and reach more people online.

chevron-down