PuTTY is a great SSH terminal progam for Windows. Using this tutorial you’ll be able to auto login to a remote server without being prompted for a username or password. Do NOT do this in a public machine.

1. Download PuTTY from http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe

2. Install and then run PuTTYgen from the programs menu.

3. Select SSH2-DSA from the bottom and hit the Generate button. Move the mouse a bit and hit ctrl-c to copy the key.

4. Click on Save Private Key. Click Yes to save it without a passphrase. I would put it in your “My Documents” directory, but you can place it wherever. Make sure you save it with a .ppk extension.

5. Open the Pageant  program for the PuTTY menu. It will put in icon in the system tray. Right click on it and click on Add Keys. Now navigate to where you saved the key file, select it, and hit Open.

6. Lauch PuTTY and type in the hostname to connect to. Type the name again in the Saved Sessions. Then click on the Data option under Connections and put your username in the Auto-login field. Click on Session at the top then click Save to save the session.

7. Click Open and PuTTY will connect to the server and display “Using Username “<your user>”. Put in your password.

8. If you’ve never used SSH from your target server, you will now need to “ssh localhost” so your .ssh directory will be created and with the right permissions. If you had to ssh localhost, now type exit to get back to your original shell and cd into the .ssh dir.

9. Use your favorite text editor to create “authorized_keys2″ and paste your key into it (right or middle mouse button).

10. Permissions on authorized_keys2 will probably be -rw-rw-r– so you will need to type “chmod g-w authorized_keys2″ to remove group write access, otherwise authorized_keys2 will not be used by ssh.

11. Close your shell session and open PuTTY again. If you did this right then you will now be able to double click on your host and connect without being prompted for a username or password. Another option to open the host is to right click on the Pageant tray icon and click on Saved Sessions to open up a comonly access host.

12. You will now need to get the Pageant program launched upon Windows Startup so you don’t have to open it every time. This can be done by (at least in Vista) by going to the Start Orb, All Progams, PuTTY, right click on Pageant and select copy. Now scroll down and right click on Startup and click Open. Now right click in the empty white space and select Paste Shortcut.

13. You will probably want to start Pageant at windows startup and/or start pageant with your saved key loaded. To do so, right click on the Pageant shortcut, click on properties, then change the target to something like this – “C:\Program Files\PuTTY\pageant.exe” “C:\Documents and Settings\ptrost\My Documents\key.ppk”

14. The quickest way to retrieve the key if you want to add it to another server and it’s not in your copy/paste buffer) is to open up PuTTYgen again and click Load, then select your previously saved key file. Then you can right click in the public key box to select all then again to copy.