SSH with Putty
[ Tuesday, 16 October 2007, goudacaster ]
One of my favourite tools (that I use almost everyday) is PuTTY. I use it both on Windows (very useful because Windows has no SSH client) and on Linux. It is a program that enables SSH connections using a graphical interface. It also allows for the establishment of SSH tunnels as well as omitting some of the restrictions to Internet access.
Using PuTTY, we gain all the possibilities described in the article SSH Tunnels: Bypass (Almost) Any Firewall and several others, but without the necessity of using long and complicated commands at the terminal. I have mentioned this article (pazkooda (2006)) because knowledge about things on the backend of SHH is very useful. What’s more, PuTTY gives us an opportunity to connect to the outside world even if we only have access to ports 80 or 443 (both usually available on office networks). PuTTY can be downloaded from this website. You can also find lots of additional software, such as PSCP and PSFTP (both mechanisms for secure copy/sftp), are very useful applications used to secure file transfers over the Internet. I’ll describe those programs later on in this article.
After we run PuTTY, the following window populates the screen:
On this window you can see a couple of sessions that I created. All of the visible sessions are from different environments but directed to the same machine that operates on Ubuntu Linux. I often work in different places, so I’ve created a separate profile for each localisation.
Creating a New Session
To create a new session you should just type the name or IP address of the computer that you want to connect with, in the field “Host Name (or IP address)”, and in the field “Port” typing the port number that the SSH service is listening to.
In my example, I am connecting with port 22 (default for this service) to a non existing “ssh.jakilinux.org” server. In the field labeled “Saved Sessions” we type our session’s name (anything you want, I’ve just called it “Moja sesja”), and we click the “Save” button, so PuTTY will save the session.
And now what should we do, to omit the restrictions of the Internet access? Let’s imagine that, in our office, we connect to the Internet by a proxy server that requires authentication. Let’s say, for example, that the server’s name is “proxy.mojafirma.pl”, and it listens on the port 8080 with the user name “oudacaster”, password “12345″. In the “Category” window, we pick the “Proxy” option up and fill in fields with the proper data just like in the picture below. For simplicity, I’ve underlined the required fields on red.
Since authentication by the Windows domain is used in our office, I’ve added the domain name and a backslash (”ad\”) before the user’s name. In other cases it is not necessary.
Warning! To save the settings, we came back to the “Session” and in the field “Saved Sessions” we choose a previously created session (”Moja sesja”), then click the “Save” button. If we omit this step the changes to the settings will not be saved. Next, we are able to pick our session from the list and click the “Open” button. The result is that we get a terminal window, just like depicted below (I’ve covered the real user’s and remote system’s name):
Creating Encrypted Tunnels
Just like other SSH clients, PuTTY enables us to create encrypted tunnels. To add a tunnel to our session, we pick the session and click “Load”, which loads, or applies, the settings. Next, we choose the “Tunnels” option from the “SSH” category. In the picture below we can see one tunnel to my home network. On the fields below it, I’ve prepared a tunnel to “www.google.com” (in case our office network admin blocked my access to this page).
After filling in the required fields and clicking “Add” we see the note: L10050 www.google.com:80
This means that after successful logging in to the server, we’ll be able to access the “www.google.com” website through the tunnel (locally on the port 10050). Therefore, to get to our desired website you should just simply type the address “http://localhost:10050/” in your web browser. We may also create similar tunnels to whatever places you want, anywhere on the Web, even for FTP or IRC servers (very often this is not available through office networks).
Sending Files
The PSCP and PSFTP commands, which I mentioned earlier in this text, enable us to copy files using an encrypted SSH connection. You should download the proper files of either PSCP or the PSFTP program from the respective website mentioned earlier, and save them to a directory (for example “C:\Temp”). Next, you should run a terminal and type the following command:
pscp -load “Moja Sesja” C:\Temp\test.txt user@ssh.jakilinux.org:~/
This command will copy the file “C:\Temp\test.txt” to the remote server “ssh.jakilinux.org” of the home directory using the session named “Moja sesja”.
Warning! Linux is case sensitive just like PuTTY.
Translated by p_lupkowski, Proof-read by fgibbs
Subscribe to RSS feed for this article!
10 Comments
- A hyperlink: <a href="polishlinux.org">GNU/Linux for everyone!</a>,
- Strong text: <strong>Strong text</strong>,
- Italic text: <em>italic text</em>,
- Strike: <strike>
strike</strike>, - Code: <code>
printf("hello world");</code>, - Block quote: <blockquote>Block quote</blockquote>













Why on earth would you want to run PuTTY on Linux? Every Linux includes a perfectly serviceable OpenSSH client that can be used within whatever terminal window is your favorite.
If I’m on a PC where I don’t have the ability to install applications, then I’ll use whatever ssh client is there.
I have run PuTTY on Linux. It’s an easy way to set up SSH tunnel sessions that I use a lot. I have also set up scripts to do the same thing, either way works. With PuTTY, I can put the name of the tunnel to show as the window title, so that makes it easy to identify which tunnel is open. You can do similar things with other terminals, so again, it’s just personal preference.
I work in a shop with several unix servers, using putty in conjunction with wintabber (www.wintabber.com) has become a requirement. You can then have several putty “tabs” within a single window.
Another tip is that for setting up multiple configurations, you can save a .reg file (from regedit : My Computer\HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\).
Then make minor modifications to it (change the ..\Sessions\config_name to ..\Sessions\config_newname ; modify the HostName and WinTitle )then double-click it and presto you just made a new connection.
Wintabber sounds good, but even better get your multiple screens using GNU Screen. Screen runs on the server and creates resumable named sessions, each with multiple named, nestable ’screens’. If you have to log off, your session will continue running on the server.
http://del.icio.us/andmalc/screen
I work in a company which requires ISA Proxy Server authentication.
Tried the proxy option as explained here, without luck. PUTTY always complains:
“Proxy error: 407 Proxy Authentication Required (ISA server requires authentication to fulfill the request.Access to Web Proxy service is denied”
I tried both authentication by and bypassing Windows Domain with similar results. Perhaps something is missing when configuring the proxy access for ISA servers.
Kind of puzzled now. Suggestions are most welcomed.
Hi, i have the same probleme, if you found a solution before me…please share it
Thanks
1- using putty on linux makes no sense. I can graphically log in to my system using ssh port forwarding, which i specify by default in my Xinit script. My ssh-drivers are mounted as normal drives in my fstab. None of this is required or works with putty. Putty is a windows program. Yes, there is a linux port. But it only exists to fool idiots, i’m sure. SSH support is pretty much built-in.
2- using putty on windows makes more sense, but is still akward. Why even use windows for this scenario? Just use a live-cd, or run some mini-distro using virtualization.
Using a liveCD or even a VM on Windows just to be able to use SSH sounds like overkill to me…
I hope that, unlike me, you can install applications on your workstation. Good luck.
http://chim0.blogspot.com/2006/08/ssh-with-putty-through-proxies.html
There isn’t always the option of running a live CD. Especially at campus workstations where some labs might only use WINXP. So it has its moments.
I use it all the time to tunnel ftp/gnump3d/other on my slack box.