PEM to PPK with puttygen

Published: March 12, 2018 (Updated: Mar 12, 2018)

Enjoying this content? Subscribe to the Channel!

Mastering PuTTY: The Essential Guide to Converting PEM Keys to PPK for AWS and Linux

Hello, tech fans, and welcome back to Darren’s Tech Tutorials!

If you’ve ever tried to manage your cloud infrastructure from a Windows machine, you know the frustration. You set up a fantastic Linux server—maybe on Amazon Web Services (AWS)—and the platform hands you a secure key file ending in .pem. But when you try to use that key with our old friend PuTTY on Windows, it simply refuses to connect!

Why the headache? Because PuTTY requires a specific format: the PuTTY Private Key format, or .ppk.

The good news? The solution is fast, easy, and only requires one dedicated tool: PuTTYgen. In this comprehensive guide, we’ll walk you through the simple steps to convert your critical PEM file into the secure PPK format, getting you connected to your Linux servers instantly.


What You Need Before Starting

Before diving into the conversion process, make sure you have the necessary tools installed. Both PuTTY and PuTTYgen are required and come bundled together in the official package.

  1. Your PEM Key File: The key file you received from your server provider (e.g., my-aws-key.pem).
  2. PuTTY and PuTTYgen: These are essential, free utilities.

You can download the latest stable versions from the official source:

https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html


Step 1: Launching PuTTYgen

PuTTYgen is the dedicated key generation and conversion tool. Locate it in your Windows Start menu and launch the application.

When the application opens, you’ll see several options, but we are only interested in loading an existing key for conversion.


Step 2: Loading Your PEM Key into PuTTYgen

This is the most crucial part of the conversion process. Follow these steps carefully:

  1. Click the ‘Load’ Button: On the PuTTY Key Generator screen, locate and click the Load button.
  2. Locate Your PEM File: By default, PuTTYgen only shows files ending in .ppk. Since your file is a .pem, you must change the file type filter.
  3. In the file explorer window, navigate to the drop-down menu near the bottom-right (it usually says “PuTTY Private Key Files (.ppk)”). Change this selection to **All Files (.*)**.
  4. Now, locate your specific .pem file and click Open.
  5. Confirm the Import: PuTTYgen will successfully import the key and likely display a small confirmation message stating the key was imported successfully. Click OK.

At this point, your PEM key is loaded securely within the PuTTYgen environment and is ready to be converted.


Step 3: Converting and Saving the New PPK Key

Now that the key is loaded, saving it in the correct format is straightforward:

  1. Review Parameters (Optional but Recommended): You can optionally add a Key Passphrase and Confirm Passphrase for an extra layer of security. If you choose to use one, you will be prompted for this password every time you connect via PuTTY. For many users, leaving this blank is acceptable.
  2. Save the Private Key: Click the Save private key button.
  3. Handle the Passphrase Warning (If Applicable): If you did not enter a passphrase (Step 1), PuTTYgen will pop up a warning asking if you are sure you want to save the key without protection. Click Yes to proceed.
  4. Name and Save: Choose a recognizable name for your new key (e.g., my-aws-key.ppk) and save it in a secure location.

Congratulations! You now have a working .ppk key file ready for use with PuTTY.


Step 4: Testing the New PPK Key with PuTTY

The final step is the confirmation: connecting to your AWS Linux machine using the newly generated PPK file.

  1. Launch PuTTY: Open the main PuTTY application.
  2. Enter Connection Details: Under the Session category, enter the hostname or IP address of your Linux machine. Ensure the Port is set to 22 (the default SSH port).
  3. Navigate to Authentication: In the left-hand navigation pane, expand the SSH section and click on the Auth category.
  4. Browse for the PPK File: Look for the field labeled “Private key file for authentication.” Click Browse and select the .ppk file you just created in Step 3.
  5. Open the Session: Return to the Session category (at the very top of the navigation pane), and click Open.

If everything was converted correctly, PuTTY will initiate the connection, use your PPK file for authentication, and prompt you for the login username (e.g., ec2-user for AWS machines). Success! You are now securely connected.


Ready to Connect!

Converting PEM to PPK might seem like a small hurdle, but it is a vital step for any developer or administrator working across both Windows and Linux environments. PuTTYgen makes this technical translation painless and fast!

Now that you’ve mastered the key conversion, you are ready to manage all your cloud instances directly from your Windows desktop.

If you found this guide helpful, please like this blog post and head over to Darren’s Tech Tutorials on YouTube to subscribe for more practical, step-by-step technical guides! Happy connecting!