HPC4 - HOW TO LOGIN

Before using the HPC 4, make sure you are connected to the campus network (either the wired connection or the "eduroam" Wi-Fi service). If you are off campus, use Secure Remote Access (VPN). For more information on setting up VPN, please visit the dedicated webpage.

SSH with password and Duo authentication

You need to Enroll the Two Factor Authentication service in order to access HPC4 cluster, please check out the link here 

Use any ssh client to login to hpc4.ust.hk.  Here are the steps using MobaXterm as an example:

 

Enter your username (*NOT* your e-mail address, i.e. without the "@ust.hk" or "@connect.ust.hk" domain name)

login as: xxx

Select either DUO authentication method or SMS passcodes

Login done

 

SSH login bypassing Duo

When connecting to the HPC 4 cluster via SSH or transferring files via SCP, it is necessary to supply the password and pass Duo authentication. However, you can simplify this process by using SSH keys for authentication. This eliminates both password and Duo authentication for logins and file transfers.

To get started, follow these steps:

  1. On your local machine, create private and public keys. These keys are simply files.

  2. Append the public key to the ~/.ssh/authorized_keys file on the HPC 4 cluster. This allows the cluster to recognize your public key for authentication.

  3. Keep the private key on your local machine. This key will be used for authentication when connecting to the HPC 4 cluster.

Windows

Here are the steps for using Windows PowerShell to generate key pair in Windows 10/11 as an example:

Launch PowerShell as administrator on local machine.

Perform "Add-WindowsCapability -Online -Name OpenSSH.Server" in PowerShell.

Perform "Set-Service ssh-agent -StartupType Manual" in PowerShell.

Perform "Start-Service ssh-agent" in PowerShell.

Perform "ssh-keygen -t rsa -b 4096" to generate a ssh key pair in default path. 

 

Perform cat C:\Users\<user name>\.ssh\id_rsa.pub | ssh <user name>@hpc4.ust.hk "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >>  ~/.ssh/authorized_keys" to copy your public key to HPC4 cluster.

User ssh login

 

 

Windows with MobaXterm

If you use the MobaXterm ssh client in above, this set of directions may be useful to setup key-based authentication.