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.

Whether/how you can connect to a University cluster using SSH (or the related protocols SCP and SFTP) depends on:

  • Where you are connecting from:
  • Whether Multifactor Authentication (MFA) has been enabled on your University account. If MFA has been enabled then when logging in with SSH you will be prompted to enter a one-time code or send a push notication to your MFA device after entering your username and password.
  • Whether you want to use password-based authentication or ‘public-key’-based authentication.

Authentication requirements per cluster:

Cluster From campus or via VPN From off campus and without a VPN connection
Bessemer Password or public key Not permitted
ShARC Password or public key Not permitted
Iceberg Password or public key Requires password (including MFA, if enabled for your account); public key authentication not permitted after 15th May 2020

SSH client software on Windows

Download and install the Installer edition of MobaXterm.

After starting MobaXterm you should see something like this:

../_images/mobaxterm-welcome.png

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

../_images/mobaxterm-terminal.png

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 Bessemer, 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]$CLUSTER_NAME.shef.ac.uk

Here you need to:

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

Note

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:

qsh

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.

Note

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 Bessemer ShARC and Iceberg. and