How to Change Private Key Format to Use with PuTTY
This guide will show you how to change your private key format, to use with PuTTY, which is a Secure Shell (SSH) client for Windows that can connect to a remote machine. If you're using SSH on Linux, then this tutorial isn't for you. PuTTY doesn't support the SSH private key format created by OpenSSH on Linux Operating Systems, so you have to convert the private key to the PuTTY required format. To connect to a remote machine with PuTTY, your private key should have a ppk format.
Prerequisite:
- Windows
- PuTTY
- Private Key
Procedures:
- Download and install PuTTY
- Make a copy of your private key just in case you lose it when changing the format.
- From the Start menu, go to All Programs then PuTTY and then PuTTYgen and run the PuTTYgen program.
- In the Parameters section, for the "Type of Key to generate:", select "SSH-2 RSA" and for "Number of bits in a generated key:", leave the default value of "2048". You can change the default value depending on your configuration.
- Click Load.
- Change the "PuTTY Private Key Files (*.ppk)" drop-down menu option to "All Files (*.*)".
- Find and select the Private Key file, then click "Open".
- A PuTTYgen information notice message dialog will pop up, click OK.
- Change the key comment from imported-openssh-key to something meaningful. This comment appears on your PuTTY screen when you connect to your server.
- Click "Save Private Key", and in the PuTTYgen Warning dialog box, click Yes.
- Choose a name for the key for example putty_Key.ppk file and save as type .ppk (PuTTY Private Key Files), by entering the .ppk extension. This ensures that you aren't overwriting the original private key.
- Click Save, close the PuTTY Key Generator window and remember the location of the private key file for future use.
Congratulations, you have successfully converted your private key from OpenSSH format to PuTTY format.