Cloudflare Zero Trust SSH Access
Step 1: Install cloudflared
Download and install the Cloudflare proxy tool for your operating system from the official GitHub repository:
https://github.com/cloudflare/cloudflared
Step 2: Configure SSH
Open or create your SSH config file (~/.ssh/config on macOS/Linux, or C:\Users\YourUsername\.ssh\config on Windows).
Add the following lines, replacing your_username with the actual server username, and replace sto.cucu.rest with the target server's URL. You can add multiple blocks for multiple servers.
Host hku-sto
HostName sto.cucu.rest
User your_username
ProxyCommand cloudflared access ssh --hostname %h
Step 3: Connect and Authenticate
ssh hku-sto
* The email should end with @connect.hku.hk or @hku.hk. You only need to do this email verification once. Your device will be remembered for a month.