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 AI Research System
Login node | Role | Usage |
---|---|---|
ai-research.hku.hk | Head Node and Compute Node | Reserved for file editing, file transfer, 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 & AI-Research system run Linux. 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.hk
to login to the login node with your HKU portal UID as the username ( e.g. tmchan, rather than tmchan@hku.hk). - 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.
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.
HPC-one Web Terminal
- The web-based terminal at the HPC-one web portal supports command line access
- N.B. Closing a browser tab of web terminal would close the session
- Session timeout would occur in idle terminal
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
- 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 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
HPC-one: File Manager
The web-based File Manager at the HPC-one web portal supports upload, download with drag and drop of files/folders < 10GB
User Guide