Last updated on February 3rd, 2022 at 02:12 pm
Passwordless SSH Login Using Putty in 4 Steps
Passwordless login will be very easy for users since they don’t have to provide password while log in from windows to linux / unix using putty.
You can also provide your username in putty under
Connection > Data > Auto-login username and save the session. This will ensure that you don’t even have to type username while logging in to unix / linux server using putty. There is some security risk associated with that though 🙂
Check out these tutorials
SSH Without Password Between Unix / Linux Servers
Ok let us get back on how to set up passwordless login, The username i am using is admin2. These steps are simple and straight forward with pictures.
Download puttygen.exe file. Or go to http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Generate key using Puttygen.
2)Click on Generate
3)Wait for some time. Move your cursor over the place shown below for the software to progress and complete.
4)Once done click on Save Private Key. (Make sure you click NOÂ for the prompt asking you to provide Key passphrase.)
5)Provide a name for the key. Here i have given my_server_private.ppk and saved it on my windows locationÂ [C:\putty_key\my_server_private.ppk ]
6)Copy public key as shown. Make sure you highlight the entire key content properly as shown below. Paste it on a notepad or any editor you like.
Copy Public key to the server.
1)Login to your server using putty.
2)Provide username / password as usual.
3)Make sure username / id you are using has a home directory otherwise create one.
4) Create .ssh folder under your user home directory if doesn’t already exists and create a authorized_keys file inside that. Add the public key details to the file using vi editor .
#Change Directory To Home $cd #make .ssh folder if doesn't already exists $mkdir .ssh $chmod 700 .ssh $cd .ssh #create a file named authorized_keys and paste the public key copied in the previous step from puttygen.exe $vi authorized_keys #save the file. $chmod 600 authorized_keys
1)Open putty and provide hostname
2) Go To Connection > SSH > Auth and provide the Private key file for authentication as shown below. ( C:\putty_key\my_server_private.ppk )
3)Click open. (Make sure to save this configuration so that you don’t have to provide the Private key file location and hostname again and again)
4)Here is how my login looks like, Also i have provided my home directory details along with the file permissions (.ssh folder should be 700 and authorized_key should be 600).
Thanks!!! Please don’t forget to LIKE us on Facebook if you like this tutorial 🙂