System Login

To interact with a system via a terminal (a window for user to type commands), a user may run a secure shell (SSH) client software on a local device (e.g. PC) to remotely connect to any login nodes below. All network traffic is encrypted and optionally compressed to support strong authentication measures for secure communications. For the sake of data and system security, terminal and file transfer access to the login nodes are only allowed within the HKU campus network and prior connection to the HKUVPN2FA is needed for off-campus access.

For HPC2021 System
Login node Role Usage
hpc2021.hku.hk Head Node Reserved for file editing, compilation and job submission/management
hpc2021-io1.hku.hk

hpc2021-io2.hku.hk
IO Node Reserved for file transfer, file management and data analysis/visualization
For 2015 System
Login node Role Usage
hpc2015.hku.hk Head Node Reserved for file editing, compilation and job submission/management
hpc2015-file.hku.hk IO Node Reserved for file transfer, file management and data analysis/visualization
For AI Research System
Login node Role Usage
ai-research.hku.hk Head Node and Compute Node Reserved for file editing,  file transter, compilation and job submission/management

SSH login

Some preinstalled secure-shell clients in major Operating System are listed below.

Operating System SSH Client How to Open
Microsoft Windows 10 Command Prompt Type ‘cmd‘ in Windows Search Bar
Linux Terminal Press Ctrl+Alt+T
macOS Terminal Double click the app at /Applications/Utilities/Terminal

More advanced third-party SSH clients are available, such as Putty and MobaXterm for Microsoft Windows.

HPC2021 runs Linux and reading of this user guide and using of the system assumes familiarity with the Linux/Unix system environment. In order to get an understanding of the Linux/UNIX, please study the UNIX user’s guide.

  1. On a SSH client’s command line, type ssh UID@hpc2021.hku.hk to login to the login node with your HKU portal UID as the username ( e.g. tmchan, rather than tmchan@hku.hk).
  2. Upon first connection, the client would ask for confirmation to accept the host key of the login node, type “Yes” to proceed.
  3. Type your initial password in the account confirmation email OR your HKU portal password if it is reset after the account creation. Any password typed will not be shown on the screen for the sake of security.

N.B. Do not use “passwd” command to change your password, please change it by changing your HKU Portal PIN described here.

SSH logout

To end the SSH session, type the logout command such as “exit” or logout“. This command might vary between servers. You may also close the session by using the Close button.


Screen Session

Because an SSH terminal relies on network connection to keep it running, any drops or hiccups in the connection may lead to termination of long-running tasks such as data visualization or software compilation. A utility called screen allows users to resume the terminal session in case of disconnection.

Create screen

Start a new screen session with a name to easily identify multiple screen sessions. To create a new session named “myscreen_1”, run the following in an SSH terminal on a login node. A new terminal will be created.

$ screen -S myscreen_1

Reattach screen

In case the terminal’s network connection is broken , you may login to a new SSH terminal and run the following to reattach to the disconnected screen terminal named “myscreen_1” to resume your work.

$ screen -r myscreen_1

Detailed usage of screen is available here.


Data Transfer

Secure data transfer should be made using program supporting SSH File Transfer protocol (SFTP) like Filezilla Client and WinSCP, which is a network protocol that provides secure file access, file transfer and file management functionality.

Graphical SFTP Client

Below is an example using FileZilla client

  1. Start FileZilla (download it free from http://filezilla-project.org/download.php (Intel version)).
  2. Click File -> Site Manager.
  3. In the Server-Type drop-down menu, select SFTP – SSH File Transfer Protocol.
  4. In Host, type the hostname of the login nodes.
  5. In Port field, type 22.
  6. Select “Normal” in Logon Type dropdown menu.
  7. In User and Password, type your HKU Portal UID and HKU Port PIN respectively.
  8. Click “Connect”.
  9. You will see a pop-up window below. This is a feature of the SSH protocol. It is designed to protect you against a network attack known as “spoofing” which will secretly redirect your connection to a different computer in order to steal your password. Click OK to continue.
    1. To upload a file, drag the file from the the left window to the right window.
    2. To download a file, drag the file from the right window to the left window.

Command-line SFTP client

Data transfer via command line program like scp and rsync may be performed as below.

scp

$ scp $SRC_FILE $LOGIN@hpc2021-io1.hku.hk:$DST_FILE

Example: Upload a file, data.txt, from a local device to the “data” folder under tmchan’s home folder in HPC2021.

$ scp data.txt tmchan@hpc2021-io1.hku.hk:~/data

rsync

$ rsync -av $SRC_FOLDER $LOGIN@hpc2021-io1.hku.hk:$DST_PATH

Example: Upload a folder, 2021-data, from a local device to the “data” folder under tmchan’s home folder in HPC2021, where broken connection can be resumed.

$ rsync -av ~/2021-data tmchan@hpc2021-io1.hku.hk:~/data