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
|hpc2021.hku.hk||Head Node||Reserved for file editing, compilation and job submission/management|
|IO Node||Reserved for file transfer, file management and data analysis/visualization|
For 2015 System
|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
|ai-research.hku.hk||Head Node and Compute Node||Reserved for file editing, file transter, compilation and job submission/management|
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 ‘
|macOS||Terminal||Double click the app at /Applications/Utilities/Terminal|
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.
- On a SSH client’s command line, type
ssh UID@hpc2021.hku.hkto login to the login node with your HKU portal UID as the username ( e.g. tmchan, rather than firstname.lastname@example.org).
- Upon first connection, the client would ask for confirmation to accept the host key of the login node, type “
Yes” to proceed.
- 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.
To end the SSH session, type the logout command such as “
logout“. This command might vary between servers. You may also close the session by using the Close button.
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.
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
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.
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
- Start FileZilla (download it free from http://filezilla-project.org/download.php (Intel version)).
- Click File -> Site Manager.
- In the Server-Type drop-down menu, select SFTP – SSH File Transfer Protocol.
- In Host, type the hostname of the login nodes.
- In Port field, type 22.
- Select “Normal” in Logon Type dropdown menu.
- In User and Password, type your HKU Portal UID and HKU Port PIN respectively.
- Click “Connect”.
- 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.
- To upload a file, drag the file from the the left window to the right window.
- 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
rsync may be performed as below.
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 email@example.com:~/data
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 firstname.lastname@example.org:~/data