Wiss. Rechnen » Connecting
 

Connections to the cluster are usually done using the SSH Protocol. Linux and MacOS support this protocol natively, for Windows several third-party programs to establish SSH connections are available. For transferring data, the Secure Copy function (scp) exists. While SSH mostly focuses on the Linux console, it is also possible to open application windows via the X window system, if the connection and your system are set up for it.

The address of the cluster will be e-mailed to you upon registering your account. You can reach the cluster by typing:

$ ssh <YourUsername>@<cluster address>

On this page you will find more detailed information for setting up SSH connections from LinuxMac OS and Windows. You should read through the Linux section in any case because the others heavily reference it.

The authentication for your login on the cluster happens by entering your username and password (this is the same password as for other Uni Siegen services, e.g. Webmail). You can also generate a public/private key pair, so that a connection from a specific computer to the cluster is possible without having to enter a password.

Caution: Your user account has to be registered for HPC access for you to be able to connect to the cluster.

By default you can only open console-based programs via an SSH connection. It is also possible to run programs that open windows, as long as an X server is available on your computer and the SSH connection is configured properly. This is also described below.

SSH setup: Linux

In the Linux console you can open an SSH connection with the ssh command.

$ ssh <YourUsername>@<cluster address>

X forwarding

For a connection with X forwarding, i.e. connections that allow opening windows, the SSH connection needs to be started with the -X option:

$ ssh -X <YourUsername>@<cluster address>

Alternatively, the -Y option does mostly the same. The difference is that with -Y the connection is treated as “trusted”, meaning fewer security checks are performed. This is only recommended if an application does not work with -X.

Configuration of SSH connections

You can preconfigure your SSH connection to the cluster so that you do not need to enter the lengthy SSH command above every time. To do that, open the file <YourHomeDirectory>/.ssh/config on your computer (not the cluster!) with a text editor and enter:

host horus
 HostName <cluster address>
 User <YourUsername>
 ForwardX11 yes

The first line is the name of your shortcut. This can be any name, in this case horus. The line User is for the username with which you want to login every time. The line ForwardX11 yes is optional. If you add this line, connections will always be started with X forwarding. This is identical to the -X option, the equivalent for -Y would be an additional line ForwardX11Trusted yes. There are other configuration options which may be useful to some to users but will not be detailed here.

With this example configuration you can now login from your computer with the shortcut

$ ssh horus

Password-less access

If you want to log in on the cluster without having to enter your password every time, you can generate a public/private key pair. This functionality is built into SSH. You have to perform the following steps:

  1. Run ssh-keygen on your local machine. This will generate a key pair, which by default has the names id_rsa (private key) and id_rsa.pub (public key). If a key pair already exists, you will get a warning message. In that case you can either cancel key generation by pressing Ctrl+C and use the existing key pair, or specify another name or path for the new key pair.
  2. You will be asked whether you want to specify a passphrase. This would be more secure, but also means that you would have to enter the passphrase at every login, defeating the purpose. You can leave the passphrase empty and simply press Enter twice.
  3. Next, you open the id_rsa.pub file with a text editor again.
  4. Log into the cluster on a new console, change into the .ssh directory on the cluster and open the authorized_keys file with a text editor.
  5. Copy the contents of id_rsa.pub into the authorized_keys file.
    Caution: Make sure that you copy the public key (.pub) and not accidentally the private key. Your private key should always stay on your local computer and you should not share it with anyone.
  6. Save the authorized_keys file.
  7. Log out from the cluster (with exit) and log back in to test whether your password-less login works.

Tip: You can put multiple key entries into the authorized_keys file if you want to log in from multiple computers, they should be separated by empty lines. An entry always consists of three parts, separated by spaces: an information block about the used encryption algorithm (typically ssh-rsa), the actual key and an optional name that you can modify. The latter helps to keep track of which key is which.

SSH setup: Mac OS

In Mac OS you can open a Linux-like console by opening the Spotlight search and typing terminal or by installing iTerm. For X forwarding you will also need XQuartz .

Setup works the same as with Linux systems, including password-less access and, if XQuartz is installed, X forwarding. However XQuartz requires another step to work. In the file ~/.ssh/config, add the lines:

host *
  XAuthLocation /opt/X11/bin/xauth

After that, X forwarding will work as it does in Linux.

SSH setup: Windows

In Windows, a number of programs to create SSH connections exist. The setup for PuTTY version 0.70 as well as MobaXTerm version 10.5 are detailed below. A pure command line tool is also available in the form of the Windows version of OpenSSH, which is explained (in German) elsewhere on the ZIMT website. You can in principle use any software that supports SSH to connect to the cluster.

Putty (and WinSCP)

To connect to the cluster using Putty, the minimum configuration you have to do is enter the cluster address in the field “Host Name” on the configuration page that opens when you launch Putty. The other fields can be left at their defaults. When you then click “Open”, a connection is already possible.

Putty-Konfigurationsfenster

It is however a better idea to create a more extensive configuration for the cluster and save it so the information does not have to be re-entered every time. In addition, all the features described in the Linux section above (X support, password-less access etc.) can be preconfigured in Putty.

Putty does not come with its own X server. For that, a separate program like XMing needs to be installed and running when Putty is started.

Putty setup

To save your settings you first need to create a “Saved Session” for the HoRUS cluster by entering a name for your session on the main configuration page and confirming it with “Save”.

The Putty configuration menu has a lot of settings pages, which you can reach by clicking on elements of the tree on the left hand side. Caution: After changing any Putty settings it is necessary to click “Save” on the main page again to save the configuration.

Useful settings in Putty are for example:

  • A previously generated public/private key pair can be used for login by going to the “Connection > SSH > Auth” page and specifying the path to the private key on your own computer. The public key needs to be copied to the cluster as described in the Linux section to enable password-less login.
  • If the box “Enable X11 Forwarding” in the menu “Connection > SSH > X11” is checked, the connection is always started with X forwarding.
  • On the page “Connection > Data”, an “Auto-Login Username” can be specified. This name will then be used automatically and does not need to be entered manually every time.

Password-less access

Putty has its own key generator named PuttyGen. It is located in the Putty installation directory (in Windows 10 you can simply enter “puttygen” in the Start menu and it will be listed). To generate a key pair you need to click “Generate” and then move the mouse around for several seconds to generate random numbers. After the key pair is created, you need to save both keys. Finally the public key needs to be copied to the cluster as described in the Linux section.

PuttyGen-Fenster

WinSCP

To copy files to the cluster or from the cluster to your computer, the scp (Secure Copy) program on the cluster can be used. Alternatively, the WinSCP program can be installed. The advanced options in WinSCP allow most of the SSH settings, similar to Putty.

MobaXTerm

To connect to the cluster using MobaXTerm, you first need to create a new SSH session. The configuration page for that session is shown below:

MobaXTerm-Konfigurationsfenster

in the “Remote Host” field you need to enter the cluster address. Like all programs described above, a username, X forwarding and passwordless access can be specified. MobaXTerm already contains an X server, you do not need to install any additional software. MobaXTerm also has a key generator in the “Tools” menu, which works identically to PuttyGen.

Aktualisiert um 17:40 am 12. August 2018 von Jan Philipp Stephan