David Lohmeyer's Blog

Using PuTTY to manage your SSH logins in Windows

This may be something you already do if you're a web developer or have anything to do with Unix but I figured it'd be a decent reference for someone just starting out.  PuTTY is your SSH client for Windows which stores login information to remote servers.  It makes it so you don't have to do things via a regular command prompt manually every time you need shell access.

What you need

  • PuTTY
  • PuTTYgen (to generate your public and private key files)
  • Pageant (for automatic SSH logins)

All of these are available on the PuTTY download page.  Just save those EXE's to any location on your computer and make a shortcut somewhere to use them (or not).  PuTTY itself can save your SSH session IP address and username.  It cannot, however, store the password to that account.  To login automatically to a Unix-based server via SSH you need to generate a public and private key via PuTTYgen.  That link also explains how to have a remote server identify you by your private key without a password.  In the remote login location make a folder called ".ssh".  Inside, make a file called authorized_keys and paste the public portion of your key in the file.  Usually you'll need ssh-rsa before the key itself.  In PuTTY, make sure to enter the default login username for your saved session under Connection > Data.

Pageant is used to load a key with a passphrase into memory.  You can create your private key without a passphrase but this is highly discouraged since anyone could get it and have access to all of the servers you do.  With Pageant, you start the program, enter your passphrase, right click the icon in your toolbar, navigate to saved sessions and pick a PuTTY session to login.  Make sure to configure Pageant with the location of your private key file on your computer (usually a .ppk file).  If you have authorized_keys configured on the remote server you will login automatically once you select the saved session in Pageant.

Related Posts