- May 16th, 2011
- Write comment
As many web developers can attest to, logging into your server through SSH (Secure Shell) is one of the more common day-to-day tasks (you can even use it as a secure tunnel for your traffic). It only makes sense to automate this process which in turn can save many many keystrokes.
- PuTTY (putty.exe)
- PuTTYgen (puttygen.exe)
Then to automate SSH login, do the following:
- Run PuTTYgen.
- Select SSH-2 DSA as the Type of Key to generate.
- Click generate and move your mouse around to generate randomness.
- Click “Save Private Key” and save it somewhere on your computer.
- Copy the entire content inside the box to your clipboard (this is your generated public key).
- Login to your SSH server.
- Create the file ~/.ssh/authorized_keys containing the generated public key(from step 3) on a single line.
- Make this file readable (chmod 755).
- Then open up PuTTY and navigate to Connection->Data and fill in the auto-login username.
- Navigate to Connection->SSH->Auth and under Private-key, browse to the file you had saved earlier on your computer.
That’s it! Now you can try logging in to your SSH server and it shouldÃ‚ login automatically. If it works, make sure you save your session so you don’t have to repeat these steps every time!
Hopefully these steps work for everyone! Let me know if there are any problems.