SSH keys are cryptographic keys used for secure communication between a client and a server. The public key resides on the server and the private key resides on the client's computer. They're essential for a secure connection, especially in untrusted networks.
PuTTY Key Generator or PuTTYgen is a key generator tool for creating pairs of public and private SSH keys. It is part of the PuTTY suite and works with Windows, Linux, and macOS. With PuTTYgen, you can create various types of key pairs, including RSA, DSA, ECDSA, and EdDSA.
This article describes how to generate SSH key pairs on Windows, as you can easily use ssh-keygen if you're using linux or macOS.
Related: How to generate SSH key pairs
Steps to generate SSH key pair using PuTTYgen:
- Download PuTTY Key Generator (PuTTYgen) for your CPU architecture from the official download site.
Related: PuTTYgen official download site
- Launch PuTTYgen.
- Select the type of key to generate and the size of the key in the Parameters section.
Use default values if you're not sure about the parameters.
- Click on the Generate button.
- Move your mouse around the blank area create some randomness as a seed for the key.
- Edit the key's comment if necessary.
- Enter a passphrase to protect the key if necessary.
- Click the Save public key button to save your public key.
Copy the content of the displayed public key instead if you want to place it in an OpenSSH server's authorized_keys file for public key authentication method.
- Choose a location and provide a filename, and click on the Save button.
- Click on the Save private key button to save the private key.
Keep the private key file secure, and do not share it with unauthorized individuals.
- Enter the location and file name for the private key and click on the Save button.
- Convert the generated private key to OpenSSH format to use the key with OpenSSH client.
Comment anonymously. Login not required.