User Tools

Site Tools


linux:putty

This is an old revision of the document!


Putty

Putty is a graphical frontend for SSH, available for Windows and Linux. On Linux, it doesn't offer much in adddition to the commandline ssh program.

Connection setup

SSH tunnels

Tunneling X-Windows over ssh using PuTTY

Our firewall prohibits direct X-Windows connection between outside and inside machines. Normally, when using ssh from a Unix machine (outside) to a local Linux box (inside) will automatically setup X11-forwarding through a tunneling mechanism. This means that all local X11 requests are translated by ssh on both sides of the connection to, what is called, a tunnel in the ssh protocol. It is possible to run a similar setup when the outside machine is a Windows based OS.

Here is a quick step through to get the tunneling up and running:

1, Setup PuTTY: First, start up the program. When PuTTY first starts up, you see the sessions screen; you need to type in the information for the computer with which you wish to connect. Notice that I have typed in the hostname in the Host Name field, that I've selected the SSH protocol radio button, and that I've given the session a name that I will be saving to. However, don't save the session yet.

2. Now, so far all we've done is created a session that we could use to log in and use the shell prompt. Next we need to tell PuTTY how we want to tunnel. On the left, under “Category”, you'll see “Tunnels” as the second from the bottom. Click on it. Then, on the right at the bottom, you'll see the “Source Port” text box. Here you will input the port that you wish to tunnel. Normally you are using display number :0 on you local machine, so you put 5900 here. If you were using port :1, you'd put 5901, etc. Finally, in the “Destination” text box below that, you'll put where that port should be forwarded. Since the “Destination” box is from the point of view of the computer you're connecting to, you have to put can put there any inside machine that has X11 access, then a colon “:”, then the port, i.e. “hostname.strw.leidenuniv.nl:5901” without the quotes. Note: before you do this you must have started the vncserver on the machine you want to connect to (hostname). Upon start of vncserver you will be informed on which display this server will work. So when vncserver responds with hostname:1 you have to set the Destination address to: “hostname.strw.leidenuniv.nl:5901”.

3. Click the “Add” button, and you should see the new tunnel “L5900 hostname.strw.leidenuniv.nl:5901” in the “Forwarded Ports:” box.

4. All you have to do is click on “Session” at the top left of the “Category:” box, then click on the “Save” button, and you have a saved session!

5. To use this tunnel, log into your machine with Putty. Then, bring up your VNC viewer and, for the VNC server that you want to connect to, type “localhost:port”, where “port” is the port you're forwarding. In this case, it's “localhost:0”.

That is it!

See also

linux/putty.1460023012.txt.gz · Last modified: 2016/04/07 09:56 by jansen