Skip to content

Connecting to a Cluster

Program Utilities

Interactive Work on a Remote Computer

We connect to the login nodes using a client that supports the SSH (Secure SHell) protocol. The SSH protocol enables secure remote connections from one computer to another, providing various options for user authentication and ensuring data integrity through robust encryption. We utilize the SSH protocol for interactive work on the login nodes, as well as for data transfers to and from the cluster.

On Linux, macOS, and Windows 10 operating systems, we can establish a connection from the command line (terminal, bash, PowerShell, cmd) by running the ssh program. On Windows 10 (April 2018 update and newer), the SSH protocol is enabled by default, whereas in older versions, it needs to be enabled (instructions, howtogeek). For older versions of the Windows operating system, a separate SSH client must be installed, with PuTTY being one of the widely used options.

Data Transfer

Secure data transfer between our computer and the remote computer is facilitated by the SSH protocol, also known as SFTP (Secure File Transfer Protocol) or FTP SSH.

To transfer data, we can utilize the scp program (Secure CoPy), which allows us to enter commands directly in the command line interface. This program comes pre-installed with the ssh program in most operating systems. For a more user-friendly experience, graphical interface programs are available. One such program is FileZilla, which is compatible with all mentioned operating systems. Additionally, for macOS and Windows operating systems, CyberDuck is a prevalent choice.

All-in-One Utilities

There are various comprehensive tools available for working with remote systems, providing support for both interactive work and data transfer. One notable tool for Windows operating systems is MobaXterm. Linux users can make use of Snowflake, while macOS users have the option of utilizing Termius (unfortunately, this tool is only available for a fee).

For software developers, we highly recommend using the Visual Studio Code development environment with the Remote-SSH extension, which is accessible for all the aforementioned operating systems.

Text Editors

To prepare jobs on the cluster, we require a file editor. File transfer programs and all-in-one utilities allow us to edit files on the cluster. On Linux and macOS operating systems, we use the default program, e.g. Text Editor, to edit simple text files. However, there is a slight complication with the Windows operating system, which uses a different line ending format. Unlike Linux and macOS, which terminate lines with the LF (Line Feed) character, Windows concludes lines with a combination of CR (Carriage Return) and LF characters. Therefore, when editing files on the cluster and using Windows on the local machine, it is advisable not to use the Notepad program but instead install Notepad++. Before saving a file to the cluster using Notepad++, we must change the format from Windows (CR LF) to Unix (LF) in the lower right corner of the program's interface.

Logging to a Cluster

Warning

Before the initial login to the cluster, we need to change our password. We log in to the website fido.sling.si, where we can manage our user profile. On the login page, we enter our username and password in the Username and Password fields, respectively, for accessing the cluster, and click the Log In button. Then, we will be prompted to enter a new password.

We launch the command line interface by pressing a special key combination on the keyboard (Super key on Linux, + Space on macOS, or the Windows key ), type "terminal," and select the suggested program. In the command prompt of the terminal window that opens, we enter the following command:

ssh <username>@nsc-login1.ijs.si

and we run the program by pressing ↵ Enter. Instead of <username>, enter your SLING SSO account username. If working with a different login node, replace the content after the @ symbol accordingly.

During the first login, when prompted with the message:

The authenticity of host 'nsc-login1.ijs.si (194.249.156.110)' can't be established.
ECDSA key fingerprint is SHA256:CuSOLdnvyAQpGxcKMQrgOQfwxSX9R1kcoqawszv5wtA.
Are you sure you want to continue connecting (yes/no)?

enter yes to add the login node with the provided fingerprint to the list of known remote systems on your personal computer.

Warning: Permanently added 'nsc-login1.ijs.si,194.249.156.110' (ECDSA) to the list of known hosts.

After entering the correct username <username> and password <password> for your user account you will be placed on the login node command prompt.

[<username>@nsc-login1 ~]$

Note

In the subsequent instructions, the command prompt on the nodes of the computer cluster will be denoted by the $ symbol. The $ symbol at the beginning of a line indicates the start of a command and should not be typed. To differentiate the command from the output that follows, there is intentionally an empty line after each command.

Enter hostname in the command prompt to execute the command on the login node, which will display the name of the remote computer. The name will be the same as the login node, in this case, nsc-login1.ijs.si.

$ hostname
nsc-login1.ijs.si
hostname

We have executed our first program on the cluster, although not in the correct manner.

Warning

Cluster administrators are very unhappy if we run heavy-duty applications directly on the login node, as this disrupts the ongoing work of other system users.

To log out from the login node, enter the command exit.

$ exit
logout
Connection to nsc-login1.ijs.si closed.
exit

Passwordless Login

After the initial login, it is recommended for security reasons to set up passwordless login. You can find the instructions here.

File Transfer

FileZilla
Launch FileZilla and enter the following information in the input fields below the menu bar: Host: sftp://nsc-login1.ijs.si, Username: <username>, Password: <password>, and click Quickconnect. Confirm that you trust the server when prompted. After a successful login, you will see the file system tree structure of your local computer on the left side of the program and the file system tree structure of the computer cluster on the right side.

CyberDuck
In the toolbar of CyberDuck, click on the Open Connection button. In the popup window, select the SFTP protocol from the dropdown menu, and enter the following information: Server (Host): nsc-login1.ijs.si, Username: <username>, Password: <password>. Then press Connect. Confirm that you trust the server when prompted. The file system tree structure of the computer cluster will be displayed.

By clicking on directories, you can easily navigate through the file system. Both programs display the current directory path above the tree structure, for example, /ceph/grid/home/<username>. Right-clicking opens a menu where you can find commands for working with directories (adding, renaming, deleting) and files (adding, renaming, editing, deleting).

In FileZilla, we transfer files between the left and right windows of the program, while in CyberDuck, we do it between the program window and regular directories. To transfer files, simply click and drag them with the mouse, and then drop them onto the desired location.

Working With Files Directly on the Cluster

You can also enter file-related commands directly into the command line. Here are some commonly used:

  • cd (change directory): to navigate through the file system

    • cd <directory>: move into the specified directory,
    • cd ..: move back to the parent directory,
    • cd: move to the home directory,
  • ls: display the contents of a directory,

  • pwd: show the current directory,
  • cp: copy files,
  • mv: move or rename files,
  • cat <file>: display the contents of a file,
  • nano <file>: edit files using the Nano text editor,
  • man <command>: access the manual pages and get help for a specific command.

Hint

You can deepen your knowledge of working in the command line by visiting the website Ryans Tutorials. It provides comprehensive tutorials on various aspects of Linux, including the command line interface. You'll find valuable resources and step-by-step guides to enhance your command line skills.

Exercise

You can find exercises to reinforce your knowledge of cluster tools here. These exercises include practical tasks that will help you better understand and use the tools required for working with a computer cluster. Follow the instructions on that page to complete the exercises and gain additional hands-on experience with cluster tools.