SSH Basics
Connections to the cluster are typically established usingthe SSH protocol. Linux and Mac OS X support this protocol by default; for Windows, there are several programs that enable SSH connections. To transfer files, you can also use the Secure Copy (scp) function, among other options; see below. It is also possible to open windows if the connection and your system are configured for this.
You will be notified of the cluster’s address via email when you set up your account. You can access it, for example, with the following command:
ssh @ This page contains detailed information on establishing an SSH connection on Linux, Mac OS, and Windows. You should definitely read the section on Linux, as the others refer heavily to it.
Authentication when logging in to the cluster is performed by entering your username. However, you can also set up a public/private key pair (see alsoWikipedia on public/private key encryption) so that you can connect to the cluster from a computer without entering a password.
Note:
- Your user account must beactivated for HPC in order for you to connect to the cluster.
- Until further notice, password-based login is disabled , even from the university network or university VPN; new users, please send your public SSH key to hpc-team@uni-siegen
By default, you can only run console-based programs via an SSH connection. However, it is also possible to run programs that open windows if anX server is available on your computer and the SSH connection is configured accordingly. This is described in more detail below.
Setting Up SSH: Linux
In the Linux console, you can establish an SSH connection using thesshcommand:
ssh @ X Support
For X support, you must start the SSH connection with-X:
ssh -X @ The alternative option-Yworks almost identically. The difference is that the connection is considered “trusted,” meaning fewer security checks are performed. This is only recommended if a program does not run with-X.
Configuring SSH Connections
You can preconfigure your SSH connection to the cluster so you don’t have to enter the entire SSH command above every time. To do this, open the file`on your local computer using a text editor and enter the following:
host omni
HostName User ForwardX11 yes The top line is the name of your alias. You can choose any name; in this example, it is“omni.” The“User”line must contain the username you use to log in to the cluster. The line `ForwardX11 yes` is optional. If you add this line, SSH connections will always be established with X support. This is identical to the -X option; the equivalent for the-Y option would beForwardX11Trusted yes. There are a number of other options described on theOpenSSH website.
With this configuration, you can log in to the cluster using a shortcut command:
ssh omniSetting Up a Key Pair
To log in to the cluster without having to enter your password every time, you can generate a public/private key pair. This feature is already built into SSH. To do this, follow these steps:
- Run `
ssh-keygen` on your local machine. This generates a key pair with the default filenamesid_rsa(private key) andid_rsa.pub(public key), which are stored in the.sshsubfolder of your local home directory. If a key pair already exists, you’ll receive a warning message. You can then either pressCtrl+Cto cancel and simply overwrite the existing key pair, or specify a different path or filename for the new key pair. - You will be asked if you want to set a passphrase. You must enter this passphrase at regular intervals.
- Next, open the
id_rsa.pubfile with a text editor. - Log in to the cluster, navigate to the
.ssh directorythere, and open theauthorized_keysfile in another text editor. - Copy the contents of
id_rsa.pubinto theauthorized_keys file.Caution: Make sure you copy the public key (.pub) and do not accidentally copy the private key. Your private key should always remain on your own computer, and you should not share it with anyone. - Save the `
authorized_keys` file. - Log out of the cluster (using `
exit`) and log back in to test whether access works.
Tip: You can store multiple key entries in`authorized_keys` if you want to log in from multiple computers. The entries should be separated by blank lines. An entry consists of three parts separated by spaces: a block of information about the encryption algorithm used (usuallyssh-rsa), the actual key, and an optional name that you can assign yourself. This helps you keep track of which key is which.
Setting Up SSH: macOS
In macOS, you can open a Linux-like console by typing“terminal”intoSpotlight Search or by installing theiTerm program. For X support, you must also install theXQuartz software.
The setup is then the same as for Linux systems. Password-less access is also possible in the same way. If XQuartz is installed, an additional step is required: the following lines must be added to the file~/.ssh/config:
host *
XAuthLocation /opt/X11/bin/xauthAfter that, X support works the same way as it does in Linux.
Setting Up SSH: Windows
There are a number of programs available for Windows that support SSH. Here, we’ll briefly explain how to set upPuTTY version 0.70 andMobaXTerm version 10.5. The Windows version of OpenSSH is a command-line-only program. However, in principle, other software can also be used as long as it supports SSH.
PuTTY (and WinSCP)
To connect to the cluster using PuTTY, you must enter the cluster’s address in the “Host Name” field on the PuTTY configuration page. The other fields can be left at their default values. Click “Open” to establish a connection.
However, it’s a good idea to save a configuration for the cluster so you don’t have to re-enter the information every time. You can also configure the same features described above in the section on Linux (X support, password-less access, etc.).
However, PuTTY does not have its own X server. To use it, you must install a separate program, such asXMing, and start it before launching PuTTY.
To save the configuration, enter a name for the configuration in the “Saved Sessions” field and confirm by clicking “Save.”
PuTTY Settings
To save settings in PuTTY, you must first create a “Saved Session” for the OMNI cluster by entering a name for the session on the main configuration page and clicking “Save.”
The Putty configuration menu contains a large number of settings that can be selected by clicking on items in the tree on the left-hand side. Note: After changing PuTTY settings, you must always save the corresponding configuration by clicking “Save” on the main page (“Session”). Useful settings in PuTTY include, for example:
- A previously generated key pair can be used to log in by specifying the path to the private key on your own computer on the “Connection > SSH > Auth” page. The corresponding public key must, of course, be copied to the cluster as described earlier so that password-less login works.
- If the “Enable X11 Forwarding” checkbox is selected in the “Connection > SSH > X11” menu, the connection will always be established with X support.
- On the “Connection > Data” page, you can specify an “Auto-Login Username.” This username will then be used automatically, so you won’t have to re-enter it every time you log in.
Password-Free Access
PuTTY has its own key generator called PuTTYgen. It is located in the PuTTY installation directory (in Windows 10, for example, you can simply type “puttygen” in the Start menu, and the program will appear). To generate a key pair, click “Generate” and then move the mouse for a few seconds to generate random values. The two keys are then saved. Finally, the public key must be stored on the cluster, as described above in the section on Linux.
Note: PuttyGen saves keys as text files, just like OpenSSH, but the format is slightly different. Once PuttyGen has generated a key, the public key appears in the window in OpenSSH format, so you simply need to copy it and paste it onto the cluster.
WinSCP
To copy files to the cluster or from the cluster to your own computer, you can use thescp(Secure Copy) program installed on the cluster; see below. Alternatively, you can use the WinSCP program. Like PuTTY, WinSCP’s advanced options also allow you to specify a username and a private key.
MobaXTerm
To establish a connection to the cluster using MobaXTerm, you must first create a new SSH session. The configuration page for this session is shown below:
The cluster address must be entered under “Remote Host.” As with the other programs described here, you can optionally configure a username, X11 forwarding, and an existing private key. The X server is already included in MobaXTerm, so no additional software needs to be installed. MobaXTerm also includes a key generator under the “Tools” menu that works identically to PuttyGen.
File Transfer
If you want to transfer files to the cluster or from the cluster to your own computer, you can do so using the Secure Copy (scp) function. If your operating system supports thesshcommand,scpis usually available as well.
The syntax works very similarly to the Linux`cp` command, with the difference that for remote systems, you must specify the computer name (hostname) and, if necessary, other SSH options such as your username:
scp : Example:
scp example-folder/example-file.txt IhrUsername@beispielhost.uni-siegen.de:/home/demo_user/Note that the path to the destination file is separated from the name of the destination system by acolon. This example would copy the source file to the remote path. If you want to copy a file from the cluster to your PC, the source file must be preceded by a hostname (along with the other SSH options). You can also copy files between two remote systems; in this case, both the source and destination files must be preceded by a hostname. If you specify a nonexistent filename as the destination, the source file will be saved under that filename. Instead of a full hostname, you can also use an SSH preset, as described above in the section on configuring SSH connections.
Unlike `cp`,`scp` displays a progress message by default when a file is being transferred.
It is not possible to run`scp`on the cluster itself; this is due to the university’s firewall settings. Regardless of the direction in which you are copying files, you must always run`scp`on your PC. Also note that you must specify the-roption if you want to copy entire folders along with their contents, similar tothe cp command. You can view additional options by running the commandman scp.
Alternatives to scp
In addition to`scp`, there are other options for file transfer. The`rsync`command works similarly to`scp`, is also available on every Linux and macOS system, and supports more complex operations such as resuming transfers after connection interruptions.
In addition, there are several graphical clients that support file transfer using various methods. Examples include the previously mentioned programs MobaXTerm and WinSCP (both Windows), FileZilla (Windows, Linux), Forklift (macOS), and the built-in file browser on GNOME-based Linux systems (e.g., Ubuntu). You’ll need to consult the respective documentation for these.