We earn commissions when you shop through the links below. Learn more
How to Use PuTTYgen: Create, Convert and Manage SSH Keys
PuTTYgen is the key generator that comes with PuTTY. This guide shows how to download it, create an SSH key, copy the right public key to your server, use the key in PuTTY, convert keys to and from OpenSSH, and change a passphrase.
WindowsMac & Linux command line.ppk & OpenSSHStep by step
Get PuTTYgen
Where to download PuTTYgen
On Windows, PuTTYgen installs automatically with PuTTY. Download the installer (the .msi file) from the official PuTTY website at chiark.greenend.org.uk/~sgtatham/putty, then open PuTTYgen from the Start menu. You can also download puttygen.exe on its own from the same page.
Only download PuTTY from its official site. Look-alike download sites have bundled malware with it in the past.
On Mac or Linux
PuTTYgen is available as a command-line tool called puttygen:
sudo apt install putty-tools # Debian / Ubuntu
brew install putty # macOS
Step by step
How to generate an SSH key with PuTTYgen
Choose the key type
Under Type of key to generate, pick EdDSA and make sure Ed25519 is selected below it. For older servers, pick RSA and set the bits to 4096.
Generate
Click Generate and move your mouse around the blank area until the progress bar fills. PuTTYgen uses the movement as extra randomness.
Add a comment and passphrase
Type a Key comment such as your computer’s name, then enter a Key passphrase twice to protect the key.
Save the private key
Click Save private key and keep the .ppk file somewhere safe. This is the file PuTTY, WinSCP and FileZilla use to log in.
Copy the public key
Select all the text in the box labeled Public key for pasting into OpenSSH authorized_keys file and copy it.
Add it to your server
Paste that line into ~/.ssh/authorized_keys on the server, or into your host’s or GitHub’s “SSH keys” page.
Common mistake: the Save public key button saves a different, multi-line format that Linux servers don’t accept. Always copy the one-line key from the text box instead.
Log in
How to use your .ppk key in PuTTY
- Open PuTTY and enter your server under Session (for example
deploy@203.0.113.10). - Go to Connection → SSH → Auth → Credentials (just Auth in older versions).
- Click Browse next to Private key file for authentication and choose your .ppk file.
- Go back to Session, type a name under Saved Sessions and click Save so you don’t have to repeat this.
- Click Open and enter your key passphrase when asked.
Stop typing your passphrase
Pageant, also installed with PuTTY, holds your unlocked key in memory. Start Pageant, right-click its icon in the system tray, choose Add Key and enter your passphrase once. PuTTY, WinSCP and FileZilla then use the key automatically until you log out.
Convert
Convert keys between PuTTY and OpenSSH formats
.ppk to OpenSSH
Click Load, open your .ppk file, then choose Conversions → Export OpenSSH key and save it without an extension, such as id_ed25519. Use this for the ssh command, Git, VS Code, macOS and Linux.
OpenSSH or .pem to .ppk
Click Load, switch the file filter to All Files (*.*), open your OpenSSH key or AWS .pem file, click OK on the notice, then Save private key.
Don’t have PuTTYgen handy? Our SSH Key Converter does both conversions in your browser.
Manage keys
Change a passphrase or fix “key format too new”
Command line
puttygen commands for Mac and Linux
Create an Ed25519 .ppk key
puttygen -t ed25519 -C "work-laptop" -o key.ppk
Show the OpenSSH public key
puttygen key.ppk -O public-openssh
Convert .ppk to OpenSSH
puttygen key.ppk -O private-openssh -o id_ed25519
Convert OpenSSH or .pem to .ppk
puttygen id_ed25519 -o key.ppk
Need a server?
Put your new key to work
Most VPS hosts let you paste your public key when you create a server, so you can log in with PuTTY right away.
Simple cloud servers with great docs. Add your SSH key when you create a Droplet.
From about $4/month
View DigitalOcean deals4 GB of RAM and NVMe storage on the entry VPS plan, with an easy control panel.
About $5.19/month on a 24-month term with our extra 20% off
Get 20% off Hostinger VPSYearly KVM VPS deals for about the price of one month elsewhere. Great for learning.
From about $11/year on promo
View RackNerd dealsPrices are approximate. Compare all VPS hosts, including Vultr and ShockHosting.
FAQ
PuTTYgen questions, answered
What is PuTTYgen?
PuTTYgen is the SSH key generator that comes with PuTTY. It creates public and private key pairs, saves them in PuTTY’s .ppk format, and converts keys to and from the OpenSSH format used by most other tools.
Which key type should I choose in PuTTYgen?
Choose EdDSA with Ed25519 for new keys. It is fast, short and secure. Choose RSA with 4096 bits only if you need to connect to an older server that does not support Ed25519.
Why does my server reject the key I saved with Save public key?
That button saves the public key in a multi-line format used by some commercial SSH servers. Linux servers expect the single-line OpenSSH format shown in the box at the top of PuTTYgen, so copy and paste that text instead.
Is PuTTYgen safe to use?
Yes, when downloaded from the official PuTTY website. It generates keys locally on your computer, and PuTTY is actively maintained with regular security updates, so keep it up to date.
Can PuTTYgen open a .pem file from AWS?
Yes. Click Load, change the file type filter to All Files, choose the .pem file and then click Save private key to create a .ppk file you can use in PuTTY.
Do I need PuTTYgen if I use Windows Terminal?
No. Windows 10 and 11 include the OpenSSH ssh-keygen command, which you can run in PowerShell or Windows Terminal. PuTTYgen is mainly needed if you use PuTTY, WinSCP or FileZilla.
Prefer the OpenSSH way?
Learn how to create a key with ssh-keygen on Windows, Mac and Linux, add a passphrase and load it into ssh-agent.