To generate an SSH key pair in Windows, with the PuTTygen software, you have to follow several steps. We will first run the PuTTY key generator (puttygen.exe).
We leave the key type part to generate on RSA. We leave the number of bits in the generated key at 2048.
1. Click the "generate" button to start creating a new key pair.
2. You have to move the mouse in the big gray square, this will help generate a key randomly. The generation progress bar advances as you move the mouse. The process takes several seconds.
3. Once the key is created, you can see it in the “key” part.
4. If you want to add a passphrase (password to enter each time you use the SSH key), enter the desired password. Enter this information again in "confirm your passphrase".
The use of passphrase is recommended when you want to use the SSH key interactively. The passphrase adds an additional layer of security by protecting the key from unauthorized use.
5. Save the private key by clicking on the “Save private key” button. You can choose any folder, just save it with the extension ".ppk" (PuTTY private key). It is advisable to put the key in a folder that you can easily find. Enter a name that will be relative to the usage of the key so you don't forget which file it is in the future.
6. Select the public key. We will copy and paste this key in the authorized_keys file on your server (for example) in the “.ssh” folder. So each time someone wants to connect to the server, they will need the private key with the passphrase (if indicated). This folder must have the correct permissions (chmod 0700).
To apply the private key, you will have to launch the Pageant software each time, select the key, enter the passphrase (if existing).
This is the best way to secure access to a server whether through SSH access software (PuTTY) or FTP software (Filezilla).
Note: Commissions may be earned from the links above.
This page contains references to products from one or more of our advertisers. We may receive compensation when you click on links to those products. For an explanation of our advertising policy, please visit this page.