Convert PuTTY SSH Key Into OpenSSH Format

About

You need to follow the instructions below only if you need to use a key-pair generated by PuTTYgen (or stored that way) on a system that reads OpenSSH formatted keys (Linux or macOS based desktop and server systems).

Loading the key

You must have the latest PuTTY installed along with its tools (PuTTYgen is part of that tools). If you do not have PuTTYgen executable available, download and run the PuTTY installer available at:

https://www.putty.org/

Warning

Always run the most recent version of PuTTY tools.

To run PuTTYgen go to the seach bar of Windows, type there “puttygen” (1), and click on the application icon (2):

_images/puttygen_01.png

In the applicaton window, open the “File” menu (1) and select “Load private key” (2):

_images/puttygen_06.png

Select the file containing the private key in PuTTY format:

_images/puttygen_07.png

and provide the password that decrypts the key:

_images/puttygen_08.png

Convert private key

Upon the succesfull key loading, press on the “Conversions” menu (1), from there select “Export OpenSSH key” (2):

_images/puttygen_09.png

and choose under what name (and where) to save the file containing the OpenSSH formatted private key (if the converted key is RSA-based, then use “id_rsa” instead of “id_ecdsa” as a file name):

_images/puttygen_10.png

Warning

The key will be encrypted with the password previously typed during the content loading.

Now you can transfer the newly created file with the OpenSSH formatted private key to your Linux or macOS system and store it under the ~/.ssh folder.

Note

On your Linux or macOS system, do not forget to establish the right permissions on the transferred file:

chmod 600 ~/.ssh/id_ecdsa

or

chmod 600 ~/.ssh/id_rsa

Convert public key

Once the PuTTY formatted key is loaded, select the content of the public key as shown below and copy that selection:

_images/puttygen_11.png

Warning

If you need to convert the public key only for the sake of of the onboarding process, then just paste the selection into the e-mail body when replying to the onboarding request.

In that case, you do not need to save the public key in a file and follow the step explained below!

Then open Notepad and paste the selection there:

_images/puttygen_12.png

Save the content under “id_ecdsa.pub” or “id_rsa.pub” file name (depending on what algorithm was used to derive the keys), and do mind the quotes surrounding the file name:

_images/puttygen_13.png

Now you can transfer the newly created file with the OpenSSH formatted public key to your Linux or macOS system and store it under the ~/.ssh folder.

Getting help

See Getting help