Is there a way to convert PEM files to PPK files? (you may guess that Amazon EC2 gives me a PEM file, and I need to use the PPK format for SSH connectivity).
-
1never heard of ppk format, but I doubt there's anything in .NET for it. – President James K. Polk Jul 06 '10 at 22:20
-
8PPK is the Putty client format. I don't think .NET has anything to do with it. – Borealid Jul 06 '10 at 22:22
-
2Ok, I didn't realise this... So PPK is just a proprietary/weird format that exists only in Putty-land? – LoneRanger Jul 06 '10 at 23:04
-
2It's also unhelpfully the only format that FileZilla accepts. – Ryder Jun 30 '14 at 12:23
-
And the default format that AmazonWebServices puts out their keys. – Kzqai Oct 05 '15 at 14:55
-
@Kzqai is that still true? I've always received PEM formatted keys from aws, I wonder if its a distinction made for Windows users. – ThorSummoner Apr 25 '16 at 23:33
-
@ThorSummoner I was too vague, I meant .pem is always the format AWS gives us. – Kzqai Apr 26 '16 at 16:59
11 Answers
Use PuTTYGen
Creating and Using SSH Keys
Overview
vCloud Express now has the ability to create SSH Keys for Linux servers. This function will allow the user to create multiple custom keys by selecting the "My Account/Key Management" option. Once the key has been created the user will be required to select the desired SSH Key during the “Create Server” process for Linux.
Create and Use SSH Keys
- Create keys
- Navigate to “My Account”
- Select “Key Management”
- Create New Key.
- During the key creation process you will be prompted to download your private key file in .PEM format. You will not be able to download the private key again as it is not stored in vCloud Express.
- The “Default” checkbox is used for the API.
- Deploy server and select key
Connect
- SSH (Mac/Linux)
- Copy .PEM file to the machine from which you are going to connect.
- Make sure permissions on .PEM file are appropriate (chmod 600 file.pem)
- Connect with ssh command: ssh vcloud@ipaddress –i privkey.pem
- Putty (Windows)
- Download Putty and puttygen from - here
- Use puttygen to convert .PEM file to .PPK file.
- Start puttygen and select “Load”
- Select your .PEM file.
- Putty will convert the .PEM format to .PPK format.
- Select “Save Private Key” A passphrase is not required but can be used if additional security is required.
Connect with Putty.
- Launch Putty and enter the host IP address. If connecting to the 10.X private address you must first establish an SSL VPN connection.
- Navigate to Connection/SSH/Auth
Click “Browse” and select the .PPK file you exported from puttygen.
Click “Open.” When connection comes up enter username (default is vcloud).
- SSH (Mac/Linux)
Instructions copied from here

- 17,518
- 14
- 92
- 123

- 17,414
- 6
- 46
- 63
-
Thanks, I did this and it worked! LoneRanger, I think you can mark this as the correct answer :-) – Kevin P. Nov 20 '10 at 14:38
I'm rather shocked that this has not been answered since the solution is very simple.
As mentioned in previous posts, you would not want to convert it using C#, but just once. This is easy to do with PuTTYGen.
- Download your .pem from AWS
- Open PuTTYgen
- Click "Load" on the right side about 3/4 down
- Set the file type to *.*
- Browse to, and Open your .pem file
- PuTTY will auto-detect everything it needs, and you just need to click "Save private key" and you can save your ppk key for use with PuTTY
Enjoy!

- 5,015
- 4
- 28
- 41
-
2For whom this solution doesn't work, update your puttygen from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html . My one was 2005 and could not open PEMs – mistika Sep 05 '13 at 10:56
-
47It's really funny when you're looking for how to do something you haven't in a long time, and you find the stackoverflow answer you gave 2.5 years earlier. – trex005 Apr 14 '14 at 16:31
-
2@trex005 well, stackoverflow now seems to be an extension of our memory, we don't need to remember everything in our head. – Paramvir Singh Karwal Apr 08 '19 at 12:04
-
@ParamvirSinghKarwal you are so very right... I probably use this post every year or two for my own memroy, but I don't comment any longer as it would just get annoying! – trex005 Jun 04 '20 at 16:05
If you have Linux machine just install puttygen in your system and use use below command to convert the key
pem to ppk use below command:
puttygen keyname -o keyname.ppk
Below command is use to convert ppk to pem not pem to ppk
puttygen filename.ppk -O private-openssh -o filename.pem

- 331
- 3
- 11
-
And you can install putty on most Linux distro's - there's a nice list here: https://command-not-found.com/puttygen – Oly Dungey Feb 11 '20 at 17:11
-
What's wrong in below commend to convert pem to ppk puttygen keyname -o keyname.ppk – Deepak Sharma Feb 19 '20 at 07:34
-
you have edited and mention the command that is use for converting ppk to pem – Deepak Sharma Feb 19 '20 at 07:37
-
Please dont use sudo as official document says , the commands mention above are correct. puttygen filename.ppk -O private-openssh -o filename.pem – subhashis Oct 19 '21 at 09:17
- Download puttygen
- Then open puttygen
- click load
- Set the file type to . all files
- Save PrivateKey
- and then u can just save any name that file became an ppk file

- 6,538
- 5
- 47
- 64

- 191
- 1
- 2
To SSH connectivity to AWS EC2 instance, You don't need to convert the .PEM file to PPK file even on windows machine, Simple SSH using 'git bash' tool. No need to download and convert these softwares - Hope this will save your time of downloading and converting keys and get you more time on EC2 things.
-
1
-
-
The answer is correct but does not address the question in the title – Oly Dungey Feb 11 '20 at 17:08
-
1In my opinion, this does address the question. It's not like suggestions to "just use abc instead of xyz", this answer is saying use ssh to do ssh because ssh doesn't require ppk. – geneorama Jul 01 '21 at 18:43
- Save YourPEMFILE.pem to your .ssh directory
Run puttygen from Command Prompt
a. Click “Load” button to “Load an existing private key file”
b. Change the file filter to “All Files (.)
c. Select the YourPEMFILE.pem
d. Click Open
e. Puttygen shows a notice saying that it Successfully imported foreign key. Click OK.
f. Click “Save private key” button
g. When asked if you are sure that you want to save without a passphrase entered, answer “Yes”.
h. Enter the file name YourPEMFILE.ppk
i. Click “Save”

- 38,521
- 31
- 149
- 235

- 915
- 13
- 5
Convert .pem file to .ppk for Windows 10
You need to do following:
1. Download PuTTYGen with Pageant.
2. Press "load" button and select your ".pem" file.
3. Press "save private key" button and save your ".ppk" file.
4. Open Pageant and press "add key" button. Just all. Keep running Pageant in background.
5. Now login through SSH or SFTP without selecting password field.

- 7,810
- 2
- 41
- 36
PuTTYgen for Ubuntu/Linux and PEM to PPK
sudo apt install putty-tools
puttygen -t rsa -b 2048 -C "user@host" -o keyfile.ppk

- 8,950
- 115
- 65
- 78

- 362
- 2
- 11
I used a trial version of ZOC Terminal Emulator and it worked. It readily accepts the Amazon's *.pem files.
The trick is though, that you need to specify "ec2-user" instead of "root" for the username - despite the example shown in the EC2 console, which is wrong! ;-)

- 19
- 1
sudo yum install putty
sudo apt-get install putty-tools
To convert your .pem file to a .ppk file
sudo puttygen pemKey.pem -o ppkKey.ppk -O private
To convert a .ppk file to a .pem file
sudo puttygen ppkkey.ppk -O private-openssh -o pemkey.pem

- 944
- 14
- 22
I had the same issue with PuttyGen not wanting to import an openSSH private key. I tried everything and what I found out was the old version of PuttyGen did not support importing OpenSSH. Once I downloaded the latest Putty, puttygen then allowed it to import the openssh private key just fine. I now have a hole in the side of my desk for pounding my head against it for the past hour.

- 645
- 1
- 7
- 17