Fork me on GitHub

Connecting to a cluster using SSH

The most versatile way to run commands and submit jobs on one of the clusters is to use a mechanism called SSH, which is a common way of remotely logging in to computers running the Linux operating system.

To connect to another machine using SSH you need to have a SSH client program installed on your machine. macOS and Linux come with a command-line (text-only) SSH client pre-installed. On Windows there are various graphical SSH clients you can use, including MobaXTerm.


You can connect to Iceberg using SSH (or the related protocols SCP and SFTP) from anywhere (on campus and off campus with/without a VPN connection) but if you are using ShARC or Bessemer and you are off-campus then you need to set up a VPN connection first (or establish one SSH connection to Iceberg then a second from Iceberg to ShARC or Bessemer).

SSH client software on Windows

Download and install the Installer edition of mobaxterm.

After starting MobaXterm you should see something like this:


Click Start local terminal and if you see something like the following then please continue to Establishing a SSH connection.


Running commands from a terminal (from the command-line) may initially be unfamiliar to Windows users but this is the recommended approach for running commands on ShARC and Iceberg as it is the idiomatic way of interfacing with the Linux clusters.

SSH client software on Mac OS/X and Linux

Linux and macOS (OS X) both typically come with a command-line SSH client pre-installed.

If you are using macOS and want to be able to run graphical applications on the clusters then you need to install the latest version of the XQuartz X Windows server.

Open a terminal (e.g. Gnome Terminal on Linux or Terminal on macOS) and then go to Establishing a SSH connection.

Establishing a SSH connection

Once you have a terminal open run the following command to log in to a cluster:

ssh -X [email protected]$

Here you need to:

  • replace $USER with your IT Services username (e.g. te1st)
  • replace $SGE_CLUSTER_NAME with sharc, bessemer or iceberg.


macOS users: if this fails then:

  • Check that your XQuartz is up to date then try again or
  • Try again with -Y instead of -X

This should give you a prompt resembling the one below:

At this prompt type:


Like this:

[[email protected] ~]$ qsh
Your job 135355 ("INTERACTIVE") has been submitted
waiting for interactive job to be scheduled ....
Your interactive job 135355 has been successfully scheduled.

Which will pop up another terminal window, which supports graphical applications.


When you login to a cluster you reach one of two login nodes. You should not run applications on the login nodes. Running qsh gives you an interactive terminal on one of the many worker nodes in the cluster.

If you only need terminal-based (command-line only) applications you can run the qrsh command, which will give you a shell on a worker node, but without graphical application (X server) support.

This video shows the connection process using MobaXterm, and then connection and running MATLAB from a qsh terminal.

What Next?

Now you have connected to a cluster, you can look at how to submit jobs with Starting interactive jobs and submitting batch jobs or look at the software installed on ShARC, Iceberg and Bessemer.