Creating a SSH tunnel using PuTTY#

Prerequisites#

PuTTY must be installed on your computer, and you should be able to connect via SSH to the cluster’s login node.

Background#

Because of one or more firewalls between your desktop and the HPC clusters, it is generally impossible to communicate directly with a process on the cluster from your desktop except when the network managers have given you explicit permission (which for security reasons is not often done). One way to work around this limitation is SSH tunneling.

There are several cases where this is usefull:

  • Running X applications on the cluster: The X program cannot directly communicate with the X server on your local system. In this case, the tunneling is easy to set up as PuTTY will do it for you if you select the right options on the X11 settings page as explained on the page about text-mode access using PuTTY.

  • Running a server application on the cluster that a client on the desktop connects to. One example of this scenario is ParaView in remote visualization mode, with the interactive client on the desktop and the data processing and image rendering on the cluster. How to set up the tunnel for that scenario is also explained on that page.

  • Running clients on the cluster and a server on your desktop. In this case, the source port is a port on the cluster and the destination port is on the desktop.

Procedure: A tunnel from a local client to a server on the cluster#

  1. Log in on the login node

  2. Start the server job, note the compute node’s name the job is running on (e.g., ‘r1i3n5’), as well as the port the server is listening on (e.g., ‘44444’).

  3. Set up the tunnel:

    ../_images/putty_tunnel_config.png
    1. Right-click in PuTTY’s title bar, and select ‘Change Settings…’.

    2. In the ‘Category’ pane, expand ‘Connection’ -> ‘SSH’, and select ‘Tunnels’ as show below:

    3. In the ‘Source port’ field, enter the local port to use (e.g., 11111).

    4. In the ‘Destination’ field, enter <hostname>:<server-port> (e.g., r1i3n5:44444 as in the example above).

    5. Click the ‘Add’ button.

    6. Click the ‘Apply’ button

The tunnel is now ready to use.