Putty is one of the top SSH clients available on Windows. It is lightweight and just runs out of the box. Doesn’t need installation and connects you to an SSH server securely. But if you need to use automatic login or use your private RSA key to login to your SSH server you need a few extra tips to do that.
Generate Public/Private Key
To generate a public/private key in Putty you need to download a tool called puttygen from Putty download page. And follow the following instructions:
1. Open puttygen.exe
2. Select Key > Generate Key Pair Menu
3. Follow the instruction to move your mouse into the blank area. See the image below:

4. Save the public key as id_rsa.pub
5. Save the private key as id_rsa.ppk
6. That’s it.
Adding Public Key into .authorized_key
To enable automatic login to your SSH server, you need to upload your id_rsa.pub content into your SSH server under .ssh/.authorized_keys. Follow the step-by-step instructions below:
1. Connect to your server using Putty normally
2. If you are connected successfully you will be in your home directory
3. If there is no .ssh folder under your home folder (usually /home/), create one using:
mkdir .ssh
4. Create .authorized_keys with this command:
touch .ssh/authorized_keys
cd .ssh
5. Open .authorized_keys with vim:
vim authorized_keys
6. Open id_rsa.pub in your local directory with notepad, and copy all the content.
7. Paste it in authorized_keys file and save it.
Automatic Login Using pageant
After you generate a public/private key using puttygen.exe, now you need to use pageant to automatically use your private key to login with Putty. Otherwise you need to add it manually under Connection > SSH > Auth in Putty every time you connect, wasting your time. The solution is to use pageant and add your private key. See the following instructions:
1. Download pageant.exe
2. Run it, and it will be running in your taskbar

3. Right click it and choose “Add Key”
4. Choose the id_rsa.ppk
5. Now you can open a new session and login without using your password anymore.
Now you need to add your id_rsa.pub key to all your SSH servers to be able to login without a password with Putty. And remember to hide your id_rsa.ppk in your safest folder, because if somebody gets this file, they can login to your server easily as well.
