Tutorial: SSH using PuTTY

Edmund Tse on Mar 2nd 2008

PuTTY is a program that allows you to use ssh on Windows. It has all the features of the Unix OpenSSH, and is an essential piece of software for any Windows user.

The instructions in the SSH Tutorial are for use within any unix environment. It’s a good idea to read this anyway, as chances are you’ll be logging in to a Unix SSH server.

SSH Public/Private Keys

In a standard installation of PuTTY, there is a tool named PuTTYgen. This is the alternative tool to the Unix ssh-keygen command which generates a public/private key pair.

Generating the public/private key pair

When PuTTYgen is run, you will be presented with a dialog box that asks you to move your mouse over the it to generate some randomness. All you need to do at this stage is move your mouse so that the cursor moves over the dialog box. Continue to move the cursor until the progress bar reaches 100%.

Afterwards, click on the “Save private key” button to output your private key to a .ppk file. Store this file in a safe location on your computer. Click on the “Save public key” button to output your public key to file. The contents of this file is equivalent to the id_rsa.pub file generated using ssh-keygen, which should be appended to the ~/.ssh/authorized_keys file on the SSH server.

Using the key/pair

To use a generated key pair when you connect to a server, you will need to reference the private key (.ppk file) when you configure the PuTTY SSH session.

Starting PuTTY, you will see a hierarchy of settings on the left hand side of the window. The settings page that we are concerned with is located under Connection > SSH > Auth. When you have selected “Auth”, you will notice that the settings page on the right hand side will change. Click on the “Browse” button for “Private key file for authentication”, then locate and select the .ppk file you have generated earlier. After the key is selected, your connection to the server will then attempt the public/private key authentication method.

Optionally, you may provide a default username to enter when you connect to the server under “Login details” on the page at Connection > Data.

Web Proxy Port Forwarding

See the background information on the SSH Port Forwarding.

Choose a host to connect to using SSH, e.g. congo1.ug.it.usyd.edu.au (or just congo1) on the standard port 22.

Go to Connection->SSH->Tunnels and set: Source port: 8000 Destination www-cache.it.usyd.edu.au:8000 Don’t forget to click add!

Click open at the bottom to start the connection. Now you can set your browser to proxy through localhost:8000 and it’ll go through the SIT web cache.

Filed in Tutorials | No responses yet

Trackback URI Comments RSS

Leave a Reply