请输入手机号码
请输入密码
香港服务器常见线路差异很大:
| 线路 | 特点 |
|---|---|
| 普通国际线路 | 晚高峰丢包严重 |
| CN2 GT | 一般 |
| CN2 GIA | 延迟低、稳定(推荐) |
| 直连/精品网 | 适合大陆访问 |
✅ 建议:
默认 22 端口常被扫描、限速。
# 修改 /etc/ssh/sshd_config
Port 52222然后重启 SSH:
systemctl restart sshdtraceroute 服务器IP
mtr -rw 服务器IPvim /etc/ssh/sshd_configUseDNS no重启:
systemctl restart sshd避免慢加密算法(如 aes-cbc)
Ciphers aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com✅ 推荐顺序:
chacha20-poly1305(移动端/弱 CPU)aes-gcm(现代服务器)ClientAliveInterval 30
ClientAliveCountMax 3编辑本地 ~/.ssh/config:
Host hk-server
HostName 1.2.3.4
User root
Port 52222
ControlMaster auto
ControlPath ~/.ssh/cm-%r@%h:%p
ControlPersist 10m✅ 效果:
Host hk-server
Ciphers chacha20-poly1305@openssh.comIdentitiesOnly yesvim /etc/sysctl.confnet.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl = 15
net.core.somaxconn = 4096生效:
sysctl -pAddressFamily inetyum install mosh
# 或 apt install mosh客户端:
mosh root@服务器IP -p 60000✅ 优点:
本地 → 国内跳板 → 香港服务器ping 服务器IP
mtr -rw 服务器IP
ssh -v root@服务器IP重点看:
Waiting for DNSAuthentication timeout✅ 香港 CN2 GIA 服务器
✅ SSH 非 22 端口
✅ UseDNS no
✅ SSH 连接复用
如果你愿意,可以告诉我:
我可以帮你做针对性优化方案,甚至帮你判断是不是该换服务器。