You can enable auto login to servers by generating private/public
SSH keys. One way to generate key pairs is to use putty tools. Below I explain
the process which is simple and easy to follow.
STEP 1: First download below tools to your windows box.
- Putty.exe (the SSH and Telnet client itself)
- Puttygen.exe (an SSH authentication agent for PuTTY, PSCP, PSFTP, and Plink)
- Pageant.exe (a RSA and DSA key generation utility)
STEP 2: Create your public key pair
- Open puttygen.exe by double clicking it
- Select “SSH-2 RSA" if this radio button is not already selected.
- Change the "Number of bits in a generated key" to 2048.
- Click the Generate key.
- Make sure that you move around your mouse INSIDE the blank area continuously until the key is generated.Once completed proceed to next step. You will see public key value populated.
- Optional but enter your passphrase (kind of password) to protect your private key. Make sure that the passphrase is recorded somewhere. If you lose the password there is no way to recover it! You need to regenerate the key pairs again.
- Save your private key.
- Copy and Save your public key.
STEP 3: Populate public key on servers
Now we must update the public key on a file ~/.ssh/authorized_keys
on the servers you are trying to access. For this you should have WRITE access
on the ~/.ssh/authorized_keys file.
If you have proper access then copy entire public key as a single
line to the ~/.ssh/authorized_keys file, save it and exit.
If you don’t have proper access, then contact your system admin to
update the file for you.
STEP 4: Load private key using pageant
You must load the private key every time you log in. This is done
with another tool called pageant.
- Open pageant.
- Add your saved private key file
- Enter your passphrase
STEP 5: Loading pageant at startup
We can ask windows to start pageant every time it boots. This is
done by placing a shortcut to it in your start menu. Follow below steps.
1
- Start → All Programs.
- Select Open from the popup menu.
- This will launch a Windows explorer for the Startup menu.
- Click on File -> New -> Shortcut
- In the popup menu, browse to C:\Program Files\PuTTY\Pageant.exe (or wherever you have pageant installed) and select that.
- This will start pageant every time you boot your Windows.
Thanks for sharing this trick I really like it.
ReplyDeleteBest Regards
Robin