How To Set Up PuTTY

This article should be considered a tutorial on setting up the PuTTY SSH for Windows. It explains from start to finish download, configuration, and connection to your SSH server!

What is PuTTY?

PuTTY is a free SSH and Telnet client designed and maintained by Simon Tatham. It is generally used for performing administrative tasks on remote servers using the SSH (Secure SHell) protocol. For PuTTY to be of any use to you, you MUST have an SSH server to connect to.

Setting up PuTTY

Download

The latest version of PuTTY can always be obtained directly from the owner's official web page. Visit the PuTTY Download Page and choose putty.exe from the file list. When you download it, I suggest that you save it to your desktop, or somewhere where it will not get accidentally deleted. PuTTY.exe is a standalone executable, meaning there is no installation involved. All profile data is saved to the Windows Registry, meaning that if you use a backup solution such as symantec_ghostFIXME you will have to recreate your profiles.

Configuration

To start configuring PuTTY, simply run the executable. You should be presented with a window similar to the following:

PuTTY Session Config Screen

PuTTY has support for saved sessions for use convenience. Generally you enter your information and configure your session as you wish, type a named in the “Saved Sessions” box, and click Save. It will add the session to the list. If you would like to edit your session settings later, simply click the session, click Load, make the appropriate changes, and click Save. For future reference you can double click a saved session to begin a session.

The first thing you want to do while configuring PuTTY is set up your hostname, connection type, possibly a unique port, and a session name. Simply input settings as given to you by your hosting provider. If you do not know these settings you can try inserting your website's domain, or address of the server you wish to connect to. If the SSH option is not selected under Connection Type, select it now. It should automatically change the Port entry to 22. If this is not the port that was given to you by your hosting company, or that you configured on your SSH Server, change the entry.

Session Name does not affect the connection, it is simply for the users convenience. Insert a descriptive session name and click the Save button. Most people use their hostname as the Session Name.

Usage

After you have created a Session, it should appear in the Session List Box. Double click your session name, your PuTTY Configuration Window should disappear. You should be presented with a popup that looks something like this:

PuTTY Key Confirmation Screen

This screen is basically informing you that you do not have this SSH Server's Encryption Key cached. This usually only happens when you've never connected to that SSH server before. If you've been connecting to the same server for a while, and you suddenly get this notification, either your host has changed its SSH server, or a different server may be impersonating your old SSH server. If this is your first time connecting to the server, click Yes to accept the Key. After you accept the key, you will not be prompted to accept it unless it changes.

After you have accepted the Key, you should be presented with your Login Dialog:

PuTTY Username Login

Simply type your username and press Enter once. Your screen should change to the following:

PuTTY Password Entry

Now you type in your password. Your password will not show up, you have to trust that it is being entered. If you make a mistake, it is best to hit the backspace button a bunch of times to make sure the invisible field is cleared. After you type your password hit enter.

If your login was success you should now see something similar to this:

PuTTY Logged In

Right under where you entered your password is your server's Message of the Day. This will be different for every server. You should now see a prompt like:

username@server-hostname:~#

From here you can issue commands in your terminal. Command responses (if there is a response) will be output after the command.

For instance, this is the command to see what user you are currently logged in as:

PuTTY Executing Command

There you go, you can now disconnect and reconnect to your SSH Server whenever you want! The next section shows you some tips and tricks for use with PuTTY…

Tips & Tricks

Automatic Username Entry

You can setup a PuTTY Profile in a way that it automatically enters a username when you start a connection with that profile. For instance, if you want to quickly be able to login as “testuser” you make make it so when you connect using a certain profile, all you will need to do is enter testuser's password.

To set this up, simply load the profile you want to change, and go to the Data child under the Connection tree. From here enter your desired username in the “Auto-login username” field.

PuTTY Auto Username

From here, go back to the Session category and Save your profile. I suggest changing the name to username@hostname for organization. Just open your session, type your password, and you should be logged in!

Setting up a SOCKS Tunnel

Introduction

You can setup PuTTY in a way that it acts like a SOCKS server, directing all data through your server. For instance, say you wanted to Proxy all your web browsing through your server. All you have to do is setup PuTTY to create a SOCKS Proxy (and tunnel), direct your browser to use 127.0.0.1 (and a port we'll specify later) as the SOCKS5 server. Any websites you visit will appear as if they are being viewed from your server. If you go to [http://www.whatismyip.com/ WhatIsMyIP] it will show your server's IP address, instead of your own.

All data between your computer and your server will be encrypted, though after it exits your server you rely on the protocol your browser was using (HTTP/HTTPS/etc). This can be beneficial when you are connected to an insecure network (such as Public WiFi). This can also be used to circumvent content filtering on various networks (such as at work or school), though it is most likely against the network's aup. Please note that you can “tunnel” any program through your server assuming that the program has support for SOCKS Proxification.

Setting up the Tunnel

To add the tunnel, load a configuration profile, then go to the Tunnel which is under SSH, which is under Connection. Choose a source port, this will be simply for your use, I suggest choosing something 1000+. In this example I use 12345. Enter the port under Source Port, then choose Destination as Dynamic.

PuTTY Enter Port Information

Click Add, and D[port] should be added to the list. In the case of Port 12345 (Dynamic) it added D12345.

PuTTY Tunnel Port Added

From here we are done setting up the tunnel. I suggest you save the profile so you can easily start your tunnel. Please note that the tunnel is not active until you are FULLY LOGGED IN to your SSH server. You may tell any program to use “Hostname: 127.0.0.1 Port: 12345” (change 12345 to your port) as a SOCKS server and all data will go through your server!

howto/how_to_set_up_putty.txt · Last modified: 2011/10/14 10:35 by 127.0.0.1
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0