Using SSH to access remote services

Overview:

  • Teaching: 20 min
  • Exercises: 0 min

Questions

  • How can I access remote HPC systems?
  • What ssh software can I use on different operatiing systems?

Objectives

  • Know how to use SSH to access remote serices and move data.
  • Know that a number of GUI clients can be used to help manage your ssh use.

SSH Clients

As HPC services are remote machines, interaction is done over an encrypted communication channel called Secure Shell version 2 (SSH-2). This allows command-line access to remote systems such as the login nodes of HPC services. From these you can run commands, submit jobs or use a command-line text editor to edit files. ssh can also be used to run graphical programs such as GUI text editors and debuggers when used in conjunction with an X server.

Logging in from Linux and macOS

Linux distributions and macOS each come with an installed terminal application that can be used that can be use for SSH access to the login nodes. Linux users will have different terminals depending on their distribution and window manager (e.g. GNOME Terminal in GNOME, Konsole in KDE). Consult your Linux distribution’s documentation for details on how to load a terminal.

macOS users can use the Terminal application, located in the Utilities folder within the Applications folder.

You can use the following command from the terminal window to login into an HPC service:

ssh [userID]@<hpc-service>

To allow remote programs, especially graphical applications to control your local display, such as being able to open up a new GUI window (such as for a debugger), use:

ssh -X [userID]@<hpc-service>

Some sites recommend using the -Y flag. While this can fix some compatibility issues, the -X flag is more secure.

Current macOS systems do not have an X window system installed by default. Users should install the XQuartz package to allow for SSH with X11 forwarding on macOS systems:

Logging in from Windows

MobaXterm

A typical Windows installation will not include a terminal client, though there are various clients available. We recommend all our Windows users to download and install MobaXterm to access HPC facilities. It is very easy to use and includes an integrated X server with SSH client to run any graphical applications.

You can download MobaXterm Home Edition (Installer Edition) from the following link:

Double-click the downloaded Microsoft Installer file (.msi), and the Windows wizard will automatically guides you through the installation process. Note, you might need to have administrator rights to install on some Windows OS. Also make sure to check whether Windows Firewall hasn’t blocked any features of this program after installation.

Start MobaXterm using, for example, the icon added to the Start menu during the installation process.

If you would like to run any small remote GUI applications, then make sure to use -X option along with the ssh command (see above) to enable X11 forwarding, which allows you to run graphical clients on your local X server.

Putty

A common option found on many University systems is to use Putty/Kitty

  • Download Putty, you should dowload putty and also download puttygen to generate keys and pageant if you want to use an agent to manage your keys.

WSL

If you are using Windows Subsytem for Linux then you can install ssh as described above in Logging in from Linux and macOS.

Moving data

There a number of programs that use thessh protocol to transfer data: scp, rsync or sftp. Alll of the advice that follows applies to the programs as well.

Log-in to a remote system

We will log-in to the Universitiy linux service: linux.bath.ac.uk

Linux users:

Open a terminal window and log-in to linux with:

ssh [userID]@linux.bath.ac.uk

Windows users

Donwload putty full windows install and follow the documentation to create a new session on linux.bath.ac.uk

Key Points:

  • ssh is a secure protocol for accessing remotes services and transfering data
  • ssh is available on Linux systems and in GUIs such as Putty and MobaXterm on Windows