ShortIQ

ShortIQ

Deployment

PPK vs PEM: Differences, Formats, and How to Convert Between Them

PPK (PuTTY Private Key) and PEM (OpenSSH) are both SSH private key formats but they work with completely different tools. This guide explains the exact differences, which format to use on Windows, Linux, and macOS, how to convert with PuTTYgen and the command line, PPK v2 vs v3 compatibility, and how to fix every common error.

May 30, 2026ShortIQ Editorial Team

PPK vs PEM: The One-Paragraph Answer

PEM (.pem) is the standard OpenSSH private key format. It is what AWS, DigitalOcean, Google Cloud, and every major cloud provider give you when you create a key pair. PEM works natively on Linux, macOS, Windows OpenSSH, Git, and all CI/CD tools. PPK (.ppk) stands for PuTTY Private Key — a proprietary format used exclusively by PuTTY and its companion tools on Windows. PuTTY cannot read PEM files directly, so you must convert PEM to PPK using PuTTYgen before connecting with PuTTY.

Both formats contain the same underlying private key. Conversion only changes the file encoding, not the key itself. The public key fingerprint stays identical, meaning the same authorized_keys entry on your server works regardless of which client you connect with.

Rule of thumb: keep the PEM file as your master copy. Only convert to PPK when you specifically need to use PuTTY on Windows. If you use the built-in ssh command in PowerShell, Windows Terminal, or Git Bash, you do not need PPK at all.

  • PEM: Linux, macOS, Windows OpenSSH, Git, GitHub Actions, AWS CLI, all cloud CLIs
  • PPK: PuTTY terminal, WinSCP, Pageant SSH agent, plink — PuTTY ecosystem only
  • Converting between formats does not change the cryptographic key
  • Always keep the original PEM file — you can regenerate PPK from it at any time

PPK vs PEM: Side-by-Side Comparison

The table below covers every tool and platform so you can find your exact situation at a glance.

  • Full name — PEM: Privacy Enhanced Mail | PPK: PuTTY Private Key
  • File extension — PEM: .pem or .key | PPK: .ppk
  • Internal format — PEM: Base64 text with BEGIN/END header | PPK: PuTTY proprietary text structure
  • Linux ssh command — PEM: Yes (native) | PPK: No
  • macOS ssh command — PEM: Yes (native) | PPK: No
  • Windows OpenSSH / PowerShell ssh — PEM: Yes | PPK: No
  • Windows Git Bash — PEM: Yes | PPK: No
  • VS Code Remote SSH — PEM: Yes | PPK: No (use PEM or ssh config)
  • PuTTY terminal — PEM: No (must convert) | PPK: Yes
  • WinSCP — PEM: No (must convert) | PPK: Yes
  • Pageant SSH agent — PEM: No | PPK: Yes
  • plink command line — PEM: No | PPK: Yes
  • AWS EC2 console download — PEM: Yes (default) | PPK: No (convert after downloading)
  • GitHub / GitLab SSH auth — PEM: Yes | PPK: No
  • GitHub Actions CI/CD — PEM: Yes | PPK: No
  • Conversion tool — PuTTYgen (Windows GUI) or puttygen command line on Linux/macOS

What Is a PEM File?

PEM stands for Privacy Enhanced Mail. The name is historical — PEM files have nothing to do with email today. A PEM file is a Base64-encoded text container used to store SSH private keys, public keys, and SSL/TLS certificates. You can open a PEM file in any text editor and see the Base64 content between the header and footer lines.

PEM is the native format of OpenSSH, which is used by Linux, macOS, Windows 10 and 11 (via the built-in OpenSSH feature), Git, GitHub, and every modern cloud CLI. When you create a key pair in the AWS EC2 console, the file you download is a .pem file. The same format is used by DigitalOcean, Google Cloud, Azure, and Linode.

On Linux and macOS you use PEM keys directly. Set permissions first, then connect: chmod 400 my-key.pem then ssh -i my-key.pem ubuntu@server-ip. On Windows with built-in OpenSSH, the same command works in PowerShell: ssh -i .my-key.pem ubuntu@server-ip. No conversion needed.

  • Modern header: -----BEGIN OPENSSH PRIVATE KEY----- (OpenSSH 7.8 and newer)
  • Legacy header: -----BEGIN RSA PRIVATE KEY----- (older PKCS#1 RSA format)
  • Permissions required on Linux/macOS: chmod 400 my-key.pem (owner read-only)
  • Works with: ssh, scp, rsync, git clone, GitHub Actions, Terraform, Ansible, AWS CLI

What Is a PPK File? (PPK Full Form Explained)

PPK stands for PuTTY Private Key. It is a proprietary format created by the PuTTY project for storing SSH private keys on Windows. The PPK full form in AWS documentation always means PuTTY Private Key. AWS guides for Windows users mention converting the downloaded .pem file to .ppk format because AWS only provides PEM keys and PuTTY cannot read them directly.

PuTTY is the most widely used third-party SSH terminal on Windows. Before Microsoft added OpenSSH to Windows 10 in 2018, PuTTY was the primary way to SSH from Windows. Because PuTTY predates modern OpenSSH conventions, it uses its own file format. PuTTYgen (included with every PuTTY download) handles creating and converting PPK files.

PPK files only work within the PuTTY ecosystem: PuTTY (terminal emulator), WinSCP (graphical file transfer), Pageant (SSH agent that holds keys in memory so you avoid retyping the passphrase), and plink (command-line PuTTY for scripts). No other SSH tool recognises the PPK format.

  • PPK full form: PuTTY Private Key
  • PPK v3 header (PuTTY 0.76 and newer): PuTTY-User-Key-File-3:
  • PPK v2 header (older PuTTY): PuTTY-User-Key-File-2:
  • Only works with: PuTTY, WinSCP, Pageant, plink
  • Conversion tool: PuTTYgen (Windows GUI) or puttygen (Linux/macOS command line)

PPK v2 vs PPK v3: Compatibility and Version Differences

PuTTY 0.76 (released July 2021) introduced PPK version 3, which uses stronger key derivation (Argon2id) compared to the older PPK v2 format (SHA-1 based). New PPK files saved by PuTTY 0.76 and later are v3 by default. Files saved by PuTTY 0.75 and earlier are v2.

The version incompatibility only affects older PuTTY installs. If you create a PPK v3 file on a new machine and then try to load it with PuTTY 0.75 or older (or an older version of WinSCP), you will see the error Not a recognised key file format or similar. The fix is either to upgrade PuTTY to 0.76 or later on all machines, or to save the PPK file in v2 format from the PuTTYgen Export menu.

In PuTTYgen, you can force v2 format by going to Key, then Parameters for saving key file, and selecting PPK version 2 before clicking Save private key. This is useful in corporate environments where all machines cannot be updated simultaneously. If you control all machines using the PPK, upgrading to a current PuTTY version is the cleaner long-term solution.

  • PPK v2: PuTTY 0.75 and older, SHA-1 key derivation, widely compatible
  • PPK v3: PuTTY 0.76 and newer, Argon2id key derivation, more secure
  • Error not a recognised key file: older PuTTY cannot read a v3 PPK file
  • Fix: upgrade PuTTY, or re-save as v2 via PuTTYgen Key > Parameters > PPK version 2
  • WinSCP: versions below 5.18 may not support PPK v3 — upgrade both together

PEM or PPK: Which Format to Use on Windows, Linux, and macOS

On Linux or macOS: always PEM. Every SSH tool on Linux and macOS reads PEM natively. There is no reason to use PPK on these platforms.

On Windows with PuTTY: you need PPK. Convert the PEM to PPK once using PuTTYgen. Keep both files. Use PPK in PuTTY and WinSCP, and PEM for everything else.

On Windows with built-in OpenSSH: PEM. Windows 10 (version 1809 and later) and Windows 11 include OpenSSH. Open PowerShell and run ssh -i .my-key.pem ubuntu@server-ip. If the ssh command is not found, go to Settings, Apps, Optional features, Add a feature, and install OpenSSH Client. No PPK needed.

On Windows with Git Bash: PEM. Git for Windows ships with OpenSSH. PEM keys work in Git Bash exactly like on Linux.

On Windows with VS Code Remote SSH: PEM. Configure the key path in your SSH config file and VS Code connects using OpenSSH.

  • Linux / macOS: PEM always — chmod 400 key.pem then ssh -i key.pem user@host
  • Windows + PuTTY: PPK — convert from PEM with PuTTYgen before first connection
  • Windows + PowerShell OpenSSH: PEM — ssh -i .key.pem user@host
  • Windows + Git Bash: PEM — same as Linux syntax
  • Windows + VS Code Remote SSH: PEM — add IdentityFile path to SSH config

AWS EC2: PEM vs PPK Workflow

AWS EC2 always generates key pairs in PEM format. When you launch an instance and create a new key pair, the file you download is a .pem file. AWS documentation covers two connection paths depending on your SSH client.

If you are on Linux or macOS, or using Windows with PowerShell or Git Bash, use the PEM file directly. If you are on Windows using PuTTY, convert the PEM to PPK first with PuTTYgen.

A practical recommendation for AWS users: download the PEM file, store it securely, and convert to PPK only if you use PuTTY. Installing Windows OpenSSH or Git Bash lets you use the PEM file directly on Windows and skip the conversion entirely.

bash
# On Linux / macOS: connect to EC2 directly with PEM
chmod 400 my-ec2-key.pem
ssh -i my-ec2-key.pem ec2-user@your-instance-ip

# Ubuntu AMIs: use ubuntu@ instead of ec2-user
ssh -i my-ec2-key.pem ubuntu@your-instance-ip

# On Windows PowerShell (built-in OpenSSH)
ssh -i .\my-ec2-key.pem ec2-user@your-instance-ip

How to Convert PEM to PPK Using PuTTYgen (Windows GUI)

Step 1: Download PuTTY from putty.org and run the installer. PuTTYgen is included — no separate download needed. After installation, find PuTTY Key Generator in the Start menu.

Step 2: Open PuTTYgen. You will see a window with a key type selector and a Generate button. Do not click Generate — you are loading an existing key, not creating a new one.

Step 3: Click Load. In the file dialog, change the file type filter from PuTTY Private Key Files (*.ppk) to All Files (*.*). This is the step people most often miss — without changing the filter your .pem file will not appear in the list.

Step 4: Navigate to your .pem file and click Open. PuTTYgen imports the key and shows the fingerprint. If the key is passphrase-protected, enter the passphrase when prompted.

Step 5: Click Save private key. When PuTTYgen asks whether to save without a passphrase, click Yes if your key has none, or add one now for extra security. Save the file with a .ppk extension. The resulting file works in PuTTY, WinSCP, and Pageant.

How to Convert PEM to PPK (and PPK to PEM) on the Command Line

On Linux, install putty-tools to get the command-line puttygen. On macOS, install putty via Homebrew. The conversions are single commands that work in scripts and CI/CD pipelines without a GUI.

bash
# Install puttygen
sudo apt install putty-tools       # Debian / Ubuntu
sudo yum install putty              # Amazon Linux / CentOS
brew install putty                  # macOS

# Convert PEM to PPK
puttygen my-key.pem -o my-key.ppk

# Convert PEM to PPK (explicit output type)
puttygen my-key.pem -O private -o my-key.ppk

# Convert PPK back to PEM (OpenSSH format)
puttygen my-key.ppk -O private-openssh -o my-key.pem
chmod 400 my-key.pem

# Save as PPK v2 (for compatibility with older PuTTY)
puttygen my-key.pem --ppk-param version=2 -o my-key-v2.ppk

# Verify the converted PEM key works
ssh -i my-key.pem ubuntu@your-server-ip

Using Your PPK File with PuTTY, WinSCP, and plink

To use a PPK file in PuTTY: open PuTTY, enter the server IP in Host Name, set Port to 22, then in the left panel go to Connection, then SSH, then Auth, then Credentials. In the Private key file for authentication field, click Browse and select your .ppk file. Back in Session, type a name in Saved Sessions and click Save to avoid reconfiguring on every connection.

In WinSCP: when creating a new site, expand the Advanced settings, go to SSH, then Authentication, and set the Private key file to your .ppk file.

plink is the command-line version of PuTTY for Windows automation scripts. It reads PPK files with the -i flag:

bash
# Connect with plink (interactive session)
plink -ssh ubuntu@your-server-ip -i my-key.ppk

# Run a single remote command (-batch skips host-key prompts)
plink -ssh ubuntu@your-server-ip -i my-key.ppk -batch "uptime"

# Accept the server host key automatically on first connection
echo y | plink -ssh ubuntu@your-server-ip -i my-key.ppk exit

Key Algorithms with PPK and PEM: RSA, ED25519, and ECDSA

Both PPK and PEM formats support the same underlying SSH key algorithms. RSA 2048 and RSA 4096 are the oldest and most compatible — every SSH server and client in existence supports RSA. ED25519 is the modern recommendation: shorter key, faster to generate, faster to authenticate, and more resistant to certain side-channel attacks. ECDSA uses elliptic curve math and is faster than RSA but slightly less widely supported than ED25519 on older systems.

When generating a new key pair in PuTTYgen, the key type selector shows RSA, DSA, ECDSA, ED25519, and ED448. Select ED25519 for new keys on any server running OpenSSH 6.5 or later (which covers all modern Linux distributions). Select RSA 4096 only if you need to connect to a very old server or appliance that predates ED25519 support.

When you create an ED25519 key in PuTTYgen and save it as PPK, the resulting .ppk file contains an ED25519 key in PuTTY format. When you convert that .ppk to .pem using puttygen -O private-openssh, the output is an ED25519 key in OpenSSH format. The algorithm is preserved through conversion — only the file format changes.

  • ED25519: recommended for new keys — short, fast, modern, OpenSSH 6.5+
  • RSA 4096: use when the target server is very old or requires RSA specifically
  • ECDSA: good but superseded by ED25519 for most use cases
  • DSA: avoid — deprecated in OpenSSH 7.0, many servers refuse DSA keys
  • Key algorithm is preserved through PEM to PPK conversion

Common Errors When Using SSH Keys and How to Fix Them

WARNING: UNPROTECTED PRIVATE KEY FILE or bad permissions: the PEM file is readable by other users. Run chmod 400 my-key.pem on Linux or macOS. On Windows with OpenSSH, right-click the file, open Properties, go to Security, click Advanced, disable inheritance, remove all entries except your own account, and grant Read permission only.

Unable to load key file in PuTTY: you are loading a .pem file directly into PuTTY. PuTTY cannot read PEM format. Convert it to PPK using PuTTYgen first, then load the .ppk file under Connection, SSH, Auth.

Not a recognised key file format (PPK v3 on old PuTTY): the PPK file was saved in v3 format by a newer PuTTY, but the machine loading it has an older PuTTY version. Fix: upgrade PuTTY to 0.76 or later, or re-save the PPK in v2 format via PuTTYgen Key, Parameters, PPK version 2.

PuTTYgen: not a recognised key file when loading PEM: the PEM file has Windows CRLF line endings. Open a terminal and run dos2unix my-key.pem, then retry the import in PuTTYgen.

Permission denied (publickey): the key file is readable but the server does not accept it. Check that you are using the correct username (ubuntu for Ubuntu AMIs, ec2-user for Amazon Linux) and that the public key fingerprint matches the one in authorized_keys on the server.

  • Bad permissions on Linux: chmod 400 key.pem
  • PuTTY cannot load .pem: convert to .ppk with PuTTYgen first
  • PPK v3 on old PuTTY: upgrade PuTTY or re-save as v2 in PuTTYgen
  • CRLF line endings: run dos2unix key.pem before converting
  • Permission denied (publickey): check authorized_keys and correct SSH username

How to Securely Store and Manage PPK and PEM Files

A private key file grants SSH access to every server that has the matching public key. Treat it with the same care as a password. Never commit PEM or PPK files to a git repository, upload them to public cloud storage, or share them in Slack or email. One accidental push to a public GitHub repository can expose the key globally before you can delete it.

Add *.pem and *.ppk to your global git ignore file: echo "*.pem" >> ~/.gitignore_global then git config --global core.excludesfile ~/.gitignore_global. For CI/CD pipelines, store the key content as an environment variable or in a secret manager (GitHub Actions Secrets, AWS Secrets Manager, HashiCorp Vault) rather than as a file checked into the repository.

Use Pageant on Windows to avoid retyping your PPK passphrase on every connection. Pageant is a PuTTY SSH agent that holds the decrypted key in memory for the duration of your Windows session. Load the .ppk file into Pageant once, and PuTTY, WinSCP, and plink all pick it up automatically. On Linux and macOS, ssh-agent serves the same role for PEM keys.

  • Add *.pem and *.ppk to .gitignore immediately — never commit private keys
  • Store in a password manager (1Password, Bitwarden) as a secure file attachment
  • For CI/CD: use GitHub Secrets or AWS Secrets Manager, not files in the repo
  • Add a passphrase to the key for encryption at rest
  • Use Pageant (Windows) or ssh-agent (Linux/macOS) to avoid retyping passphrases

FAQ

What is the difference between PPK and PEM files?

PEM (.pem) is the standard OpenSSH private key format used by Linux, macOS, Windows built-in SSH, Git, and all cloud providers. PPK (.ppk) is PuTTY Private Key format, a proprietary format used only by PuTTY and related Windows tools (WinSCP, Pageant, plink). Both contain the same cryptographic key. The difference is only the file encoding and which tools can read it. Convert PEM to PPK with PuTTYgen when you specifically need PuTTY on Windows.

What is a PPK file and what does PPK stand for?

PPK stands for PuTTY Private Key. A PPK file is an SSH private key stored in the proprietary format used by PuTTY and related tools (WinSCP, Pageant, plink) on Windows. The file starts with a header line reading PuTTY-User-Key-File-3: (version 3) or PuTTY-User-Key-File-2: (version 2). PPK files cannot be used with standard OpenSSH tools — they only work within the PuTTY ecosystem.

What does PPK stand for in AWS?

PPK stands for PuTTY Private Key. AWS generates and provides key pairs in PEM format (.pem). In the AWS EC2 connection documentation, PPK is mentioned for Windows users who connect using PuTTY. Because PuTTY cannot read PEM files, AWS instructs those users to convert the .pem to .ppk using PuTTYgen. If you use Windows OpenSSH or Git Bash instead of PuTTY, you use the PEM file directly and never need a PPK file.

Can PuTTY use a PEM file directly?

No. PuTTY requires PPK format for SSH key authentication. It cannot load a .pem file in the Auth configuration. You must first open PuTTYgen, click Load, change the file filter to All Files, select the .pem file, then click Save private key to create the .ppk file. Only then can you load the .ppk in PuTTY under Connection, SSH, Auth, Credentials.

Does converting between PEM and PPK change the SSH key?

No. The underlying RSA or ED25519 private key is identical in both formats. Converting only changes the file encoding and structure. The public key fingerprint stays exactly the same. The server does not need to be reconfigured — the same public key already in authorized_keys works whether you connect with PEM-based OpenSSH or a PPK-based PuTTY client.

Which format should I use on Windows?

It depends on your SSH client. PuTTY: use PPK (convert from PEM with PuTTYgen). Windows built-in OpenSSH (ssh command in PowerShell): use PEM. Git Bash: use PEM. VS Code Remote SSH: use PEM. The clearest approach is to start with PEM (which is what AWS and all cloud providers give you) and only convert to PPK if PuTTY is your SSH client.

What is the PPK file extension and why does it matter?

The .ppk file extension identifies a PuTTY Private Key file. Unlike PEM files where renaming .pem to .key still works, the file extension matters for PPK because PuTTY, WinSCP, and Pageant filter their file dialogs to show only .ppk files by default. The internal file format is what actually matters — a PPK file always begins with PuTTY-User-Key-File-3: or PuTTY-User-Key-File-2: internally. Renaming a .pem file to .ppk will not make it readable by PuTTY.

What is PPK v2 vs PPK v3?

PPK v2 is the format used by PuTTY 0.75 and older, using SHA-1 key derivation. PPK v3 was introduced in PuTTY 0.76 (July 2021) and uses Argon2id for stronger key protection. If you see the error Not a recognised key file format when loading a PPK file, the file is likely v3 and the PuTTY version is too old to read it. Fix: upgrade PuTTY to 0.76 or later, or re-save the file in v2 format via PuTTYgen Key, Parameters, PPK version 2.

Is the difference between .pem and .ppk just the file extension?

No. The file extension reflects a genuine internal format difference. A .pem file starts with -----BEGIN OPENSSH PRIVATE KEY----- and contains Base64-encoded OpenSSH key data. A .ppk file starts with PuTTY-User-Key-File-3: and has a completely different internal structure. Renaming a .pem to .ppk (or vice versa) will not make it work — tools check the internal format, not the extension.

What is a PEM key and what do the header lines mean?

A PEM key is a private key stored as Base64-encoded text. The header line identifies the key type. -----BEGIN RSA PRIVATE KEY----- is an older PKCS#1 RSA key. -----BEGIN OPENSSH PRIVATE KEY----- is the modern OpenSSH format used for ED25519, ECDSA, and newer RSA keys. All are PEM format and work with the ssh -i command. The modern BEGIN OPENSSH PRIVATE KEY format is the default output of ssh-keygen since OpenSSH 7.8.

How do I fix bad permissions on a PEM file?

On Linux or macOS run chmod 400 my-key.pem in the terminal. This makes the file readable only by the owner, which SSH requires. If you see WARNING: UNPROTECTED PRIVATE KEY FILE or Permissions 0644 are too open, this command is the fix. On Windows with OpenSSH, right-click the .pem file, go to Properties, Security, Advanced, click Disable inheritance, remove all inherited permissions, then add your own user account with Read permission only.

How do I convert PPK to PEM on the command line?

Install puttygen: sudo apt install putty-tools on Ubuntu/Debian, brew install putty on macOS. Convert PEM to PPK with: puttygen my-key.pem -o my-key.ppk. Convert PPK back to PEM with: puttygen my-key.ppk -O private-openssh -o my-key.pem then chmod 400 my-key.pem. To save as PPK v2 for compatibility with older PuTTY: puttygen my-key.pem --ppk-param version=2 -o my-key-v2.ppk.

Can I use the same key pair for both PuTTY and OpenSSH?

Yes. Start with the PEM file (your master key). Convert a copy to PPK for PuTTY using PuTTYgen. Both the PEM and the PPK derive from the same underlying key — the same public key entry in authorized_keys on the server authenticates connections from both PuTTY with the PPK and OpenSSH with the PEM. You never need two separate key pairs just because you use two different SSH clients.

Related free tools

If you want to turn this topic into action, use one of ShortIQ's free tools for campaign planning, UTM structure, or QR distribution.

Continue Reading

Explore more guides on link shortener SaaS strategy, Bitly alternatives, and white label link management.

Free newsletter

Get new guides in your inbox

We publish practical guides on dev tooling, prompt engineering, marketing workflows, and deployment. No fluff — straight to the point.

No spam. Unsubscribe any time.

Was this article helpful?

Tell us if this guide solved the problem or what was still missing. We use this to improve the blog and only follow up if you explicitly allow it.

We use this to improve tutorials, examples, and technical depth.