I posted a tutorial about how to enable SSH with password-less authentication in ubuntu. In this tutorial, I will show you how to also configure PuTTY in a Windows environment to use SSH Key based logins.
We will need to download PuTTY and PuTTYgen from here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. Or just download the installer which will install both for you.
At this point, logging in to my server, prompts me for a password
Lets go ahead and launch PuTTYgen and click on Generate
To generate a random key, PuTTYgen will ask you to move your mouse around. As you move your mouse, you will see the progress bar filling up, sometimes twice.
Once done, you will get a random public key. Enter anything in the Key comment field and leave Key passphrase blank. Click on Save public key and save the key somewhere safe. Normally in the Documents folder. Also, notice that by default the public key file has no extension.
Now click on Save private key and save the private key in the same location. The private key must have .ppk file extension.
Back to PuTTYgen, right click anywhere on the public key generated and click on Select All then Copy
Log on to your Linux host, if you have not already done so and type
This may create a new file for you if you are doing this for the first time. Or it may open an existing file with other public keys stored in it. In this case, it created a new blank file for us. Paste your public key there, save and exit.
Note: if your authorized_keys file already has other public keys, just add your public key at the end of the file.
Now, we just need to configure PuTTY to use or new generated private key when logging on to that specific Linux host.
Launch PuTTY and enter your Linux host’s IP address or Host Name under Session.
Under Connection -> Data, enter your username in the Auto-login username field
Under Connection -> SSH -> Auth, Click Broswe… and find your private key then click Open
Go back to Session, enter any name in the Saved Sessions field and click Save
Thats it! Try logging on to the server again. If everything worked out right, you should not be prompted for a password and should be logged in immediately using your private SSH key.