PEM to PPK file conversion is the first thing we need to do, in order to connect to the Host System with existing PEM file, using PuTTY. As PuTTY doesn’t support Privacy Enhanced Mail (.pem) file; this file has to be first convert to PuTTY Private Key (.ppk) file which is the PuTTY’s native format to store private key information.
Through this Article we are going to discuss the steps, to convert PEM (Privacy Enhanced Mail) file to PPK (PuTTY Private Key) file. These two formats are used to store private key details.
- This article applies to Windows 7 OS & Windows 10 OS
Convert PEM file to PPK file
Assuming, you have installed PuTTY on your Windows System. If not already installed, you can download it from here.
Step 1. Open PuTTYgen tool. This will display the “PuTTY Key Generator” window.
Step 2. PuTTYgen tool is used to generate the new key file(s) or convert the key file(s) to PPK – PuTTY’s own format. Click on the Load button to load the PEM file, that you have already on your System. PuTTYgen will open the “Load private key:” dialog.
Step 3. From the “Load private key:” dialog, select the “All Files (*.*)” entry from the combo box next to the “File name:” field. And then navigate to the folder location where you saved the PEM file and select the file. PuTTYgen will display the below dialog:
Successfully imported foreign key
(OpenSSH SSH-2 private key (old PEM format)).
To use this key with PuTTY, you need to
use the “Save private key” command to
save it in PuTTY’s own format.
Step 4. After clicking the OK button, key details are populated in “Key fingerprint:” and other fields. Also, observe that the “Save public key” and “Save private key” buttons are enabled.
Step 5. Select the RSA option from the “Parameters” group. By default 2048 is the value that will be there in the “Number of bits in a generated key:” field. Keep the same value.
Step 6. Now we are ready to save the loaded key details into PPK format. Click on the “Save private key” button. PuTTYgen will open the “Save private key as:” dialog allows to save the file.
Step 7. Observe that the “PuTTY Private Key Files (*.ppk)” entry is already selected in the “Save as type:” combo box. Provide the file name in the “File name:” field and click on the Save button to save the file. PuTTYgen will display the below warning message:
Are you sure you want to save this key
without a passphrase to protect it?
Yes | No
Step 7. Click on the Yes button to save the PPK file.
Now we have the PPK file from the PEM file. Using this PPK file, we can connect to the Host System, where this key is valid.