Introduction
This tutorial will guide you on how to create an SSH key using PuTTYgen in your Windows PC and how to copy this key to connect to your server.
Prerequisites
- Server running a Linux distribution
 - Local PC with Windows
 
Step 1 - Install PuTTYgen on Windows
The installation of PuTTY automatically comes with PuTTYgen. If you don't have PuTTY installed on your PC, it is enough to just download PuTTYgen (puttygen.exe — select 32 / 64 bits version according your PC, most probably 64-bit).
Step 2 - Run PuTTYgen
Double-click on the executable you just downloaded. This will open the PuTTY Key Generator window.
Step 3 - Generate SSH key
- Press the "Generate" button
 - Move your mouse around on the blank space to randomize your key
 - Change the "Key comment" field to give your key a meaningful name like: "home", "office", "home-pc-i7", etc.
 - RECOMMENDED: Enter a "Key Passphrase" to protect your SSH key. Note: This passphrase will be requested every time you try to connect using the generated SSH key.
 - Save your public/private keys safely on your PC using the buttons "Save public key" and "Save private key". Remember the location you saved your key pair in.
 - Copy the content of the field "Public key for pasting into OpenSSH 
authorized_keysfile". 
Step 4 - Copy public key to your server
Option 1: Copy key over FTP
- Connect to your server using your preferred FTP Client (eg: FileZilla).
 - Edit file 
authorized_keys(location: /home/holu/.ssh/authorized_keys where "holu" is your username). - Append the content from your clipboard (done in last substep of Step 3) into the 
authorized_keysfile. - Save.
 - Upload 
authorized_keysfile. 
Option 2: Copy key over SSH
Open your terminal / PuTTY client and type:
ssh-copy-id holu@your_server_ipStep 5 - Use the key with PuTTY
If you use PuTTY, this is how you can add your key:
- Open PuTTY
- Go to 
Connection»SSH»Auth»Credentials- Click on 
Browse...and open your private SSH key file. The file probably ends with PPK (e.g.<your-key>.ppk). 
  
     - Click on 
 - After the key is added, go back to 
Session- In the text box in the top left, enter your username and the IP address of the remote server
 - Select 
Opento connect to your server 
  
     
 - Go to 
 
Conclusion
You've created a new SSH key and copied it to your server, so you can now use it to easily and securely connect to your server. Another interesting tutorial is "How to login to your Hetzner instance with an SSH Key".