How Can We Help?
< All Topics

How To Create Public and Private Keys With PuTTYgen

PuTTY is a free open-source network file transfer application. It can support various network protocols like SCP and SSH.

PuTTYgen functions to create public and private key pairs used when connecting to your site via SSH. Although these keys are stored natively in a .pkk file format, the PuTTYgen tool can convert these keys into different file formats.

To create and use SSH keys you would need to install PuTTY. PuTTYgen is the accompanying keygen tool that comes with PuTTY used for creating keys. Due to PuTTYgen being bundled with PuTTY, there is no need to download the PuTTYgen separately.

Downloading PuTTY

To get started, if you have not yet installed PuTTY, you would first need to download the application from the PuTTY website.

Download PuTTY from:

On the PuTTY download page, right at the top, you will find the PuTTY Package Files, download the MSI Windows installer file and save it on your local computer.

Running The PuTTYgen Application

Run the Windows installer package and install PuTTY.

Once the installation is complete, locate and run the PuTTYgen application, which we will be using to generate our public and private key pairs.

Although you can customise the parameter settings for your keys, the default values of using RSA with a 2048-bit key size would be sufficient for most scenarios.

Click on the Generate button to start with the key creation.

Key Generation

You will need to move your mouse as PuTTYgen generates keys. The unpredictability of your hand movements is crucial. Depending on the key size, you might have to move your mouse for a while until key generation finishes.

Once the key generation is complete, your public key will appear in the window. It’s recommended to use a passphrase and paste it into the field to confirm. Remember to save and store your passphrase in a safe place for future use.

You have successfully generated your SSH Key Pairs, which are now ready for use. The public key can be used on multiple devices, and you can save it in plain text or use the Save public key button. This is the key that you will add to the Mshini control panel.

The private key is saved on your computer as a .pkk file. Be sure to save this file in a secure location as it will be needed to authenticate devices with your public key.

If you ever lose either key or if one is compromised, you will need to regenerate both the public and private keys using PuTTYgen.