Claw cloud 容器 VPS 搭建 hysteria2 节点

Vevc • 484 人浏览

本期摘要:Claw cloud | 容器vps | hysteria2 | 科学上网 | 代理

Claw cloud 注册地址:
https://console.run.claw.cloud/signin?link=TSWVWVN3G294

容器 VPS 项目地址:
https://github.com/vevc/ubuntu

Hysteria2 官网及项目地址:
https://v2.hysteria.network
https://github.com/apernet/hysteria

前情回顾

四种连接 SSH 的方法

  1. 开放 SSH 外网端口(第2期)
  2. 使用 xray 完成端口复用(第6期)
  3. 使用 ttyd 连接 Web SSH 终端 (第7期)
  4. 使用 EasyTier 完成异地组网(第8期)

目标:释放 TCP 端口,不至于失联。

下载安装

mkdir ~/hysteria
cd ~/hysteria
wget -O hysteria https://github.com/apernet/hysteria/releases/latest/download/hysteria-linux-amd64
chmod +x hysteria

自签证书

openssl req -x509 -newkey rsa:2048 -days 3650 -nodes -keyout key.pem -out cert.pem -subj "/CN=example.domain.com"

创建配置文件

cat > /home/$USER/hysteria/config.yaml << EOF
listen: :10443

tls:
  cert: /home/$USER/hysteria/cert.pem
  key: /home/$USER/hysteria/key.pem

auth:
  type: password
  password: vevc.HY2.Password
EOF

注意配置文件格式。

启动测试

~/hysteria/hysteria server -c ~/hysteria/config.yaml

使用 Supervisor 管理并启动

[program:hysteria]
command=/home/vevc/hysteria/hysteria server -c /home/vevc/hysteria/config.yaml
autostart=true
autorestart=true
user=vevc

导入节点

hysteria2://[email protected]:443?insecure=1#Claw-Cloud-HY2

至此,我们获得 3 个节点。