SSH: Password-less access (Putty)
In my previous post titled SSH: Password-less access (Linux) I detailed on how to do any secure.* (i.e., SSH, SCP, etc..) access between two Linux boxes. In other words, if your local box is Linux as well then the previous post would be a way to go for password less access. But what if your local box runs Windows? Well, here is a way to do the same.
Firstly, I assume you using putty for SSH-ing into the box for I am gonna detail how to do this for putty. Secondly, if you have not yet downloaded puttygen then do so before you proceed. Just like the previous post, we gonna have the same 3 steps with an additional step of configuring putty:
- Create public & private keys
- Copy public key to remote host
- Configure putty to use the private key
- Test
Create public & private keys
This is where puttygen is useful. Open puttygen and you should see this:
Click on ‘Generate.’ Once done, to create a unique seed for creating the key pair, do the following:
Now this should create a public key for you, as shown below:
Now, save the ‘Private Key’ somewhere, searchable in you system for later retrieval, and it has an extension ‘ppk’ (stands for putty private key!). In fact, this ppk file is very much human readable & you can retrieve your public key anytime as shown below:
That’s the end of first step! 🙂
Copy public key to remote host
Now to the next step. Copying the public created to the remote host. Now it is not mere copying but more like installing your public key over there. The simplest method is to append your public key into the ‘authorized_keys’ file (typically under ~/.ssh/). Choose your favorite editor and append the public key (as highlighted in the previous section) to the file. Finally your file should contain this:
Please notice that there is a ‘ssh-rsa’ token prefixed before the public key. This is very important. Don’t miss it.
Configure putty to use the private key
Now, the server is ready to receive your private key to authenticate you but we need to configure putty to send the private key. And, this how you do it.
Set the username for auto-login
My login name is ‘rp’ and so:
Set the private key
Save this session for future quick login! 🙂
Test
Open your saved session and see the magic unfold. 😉
So, there you go folks! Now we know how to login without password from Windows client as well! 🙂
Leave a Reply