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:

PuTTY -- main window

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.

Session profile

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.

Proxy server settings

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):

Terminal window

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).

PuTTY tunnels

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


Warning: include_once(/sites/polishlinux.org/wp-content/themes/jakilinuxorg/google_article_inside.php): failed to open stream: No such file or directory in /sites/polishlinux.org/wp-content/themes/jakilinuxorg/single.php on line 48

Warning: include_once(): Failed opening '/sites/polishlinux.org/wp-content/themes/jakilinuxorg/google_article_inside.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /sites/polishlinux.org/wp-content/themes/jakilinuxorg/single.php on line 48

Subscribe to RSS feed for this article!

13 Comments

fold this thread ig  Wednesday, 17 October 2007 o godz. 6:11 pm #  Add karma Subtract karma  +0

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.

(Comments wont nest below this level)
fold this thread mark  Wednesday, 17 October 2007 o godz. 9:17 pm #  Add karma Subtract karma  +1

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.

 
 
fold this thread Darrin Auxier  Wednesday, 17 October 2007 o godz. 9:07 pm #  Add karma Subtract karma  +1

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.

(Comments wont nest below this level)
fold this thread Andrew M  Thursday, 18 October 2007 o godz. 12:29 pm #  Add karma Subtract karma  +1

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

 
 
fold this thread Joe Salinas  Friday, 19 October 2007 o godz. 12:11 pm #  Add karma Subtract karma  +0

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.

(Comments wont nest below this level)
fold this thread Laurent  Thursday, 25 October 2007 o godz. 12:46 am #  Add karma Subtract karma  +0

Hi, i have the same probleme, if you found a solution before me…please share it ;)
Thanks

 
 
fold this thread Meneer R  Sunday, 21 October 2007 o godz. 4:37 pm #  Add karma Subtract karma  +0

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.

(Comments wont nest below this level)
fold this thread karouf  Wednesday, 21 May 2008 o godz. 10:35 am #  Add karma Subtract karma  +0

Using a liveCD or even a VM on Windows just to be able to use SSH sounds like overkill to me…

 
 
fold this thread Laurent  Thursday, 25 October 2007 o godz. 1:04 am #  Add karma Subtract karma  +0

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

(Comments wont nest below this level)
 
fold this thread SIGHUP  Thursday, 10 January 2008 o godz. 5:44 am #  Add karma Subtract karma  +0

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.

(Comments wont nest below this level)
 
fold this thread Mackenzie Ward  Wednesday, 26 May 2010 o godz. 2:46 am #  Add karma Subtract karma  +0

Data Recovery is a very costly option that is why you should always check your storage media for any signs of wear and tear..”:

(Comments wont nest below this level)
 
fold this thread Isla Watson  Thursday, 15 July 2010 o godz. 4:35 pm #  Add karma Subtract karma  +0

data recovery is a very costly option, always make a regular backups.~~-

(Comments wont nest below this level)
 
fold this thread Polycarbonate %0B  Sunday, 12 December 2010 o godz. 7:08 pm #  Add karma Subtract karma  +0

of course data entry services are very expensive that is why always make a backup of your files ,;*

(Comments wont nest below this level)
 
Name (required)
E-mail (required - never shown publicly)
URI

Adjust field size: shrink | enlarge)


You can use simple HTML in your comments. Some examples are as follows:
  • 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>

About the Author

Darek Krysmann

I'm Linux enthusiast however professionally involved in Microsoft environments. I wish to contribute to OS Community by using and writing reviews of OS Software.

New AdTaily ads!

Are you a film buff?

film buffs community, movie recommendations and reviews

RSS: Comments

You can follow the comments to this article through a special channel RSS 2.0 .

Related articles: CLI

 more »

PolishLinux Top Content


Become our fan on Facebook!

PolishLinux.org on Facebook

Follow PolishLinux on Twitter!

Follow polishlinux on Twitter

Google Ads