Linux 系统 Hysteria 2 安装教程 - axcsz/Collect GitHub Wiki
-
PS:适用于 Debian & Ubuntu 系统;
-
PS:推荐SSH工具【点击进入下载 MobaXterm】、【点击进入下载 FinalShell】;
-
PS:升级更新更换好【点击此处查看 LXC 源】;
-
PS:如果使用第三方工具需要先开启允许登录。【点击此处查看如何开启】。
apt update && apt dist-upgrade -y
apt install -y curl git wget nano
# 安装或升级到最新版本 Hysteria 2:
bash <(curl -fsSL https://get.hy2.sh/)
# 移除 Hysteria 2:
bash <(curl -fsSL https://get.hy2.sh/) --remove
openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) -keyout /etc/hysteria/server.key -out /etc/hysteria/server.crt -subj "/CN=bing.com" -days 36500 && chown hysteria /etc/hysteria/server.key && chown hysteria /etc/hysteria/server.crt
- PS:端口可以修改,密码必须修改
cat << EOF > /etc/hysteria/config.yaml
listen: :443 #监听端口
#使用自签证书
tls:
cert: /etc/hysteria/server.crt
key: /etc/hysteria/server.key
auth:
type: password
password: 123456 #设置认证密码
masquerade:
type: proxy
proxy:
url: https://bing.com #伪装网址
rewriteHost: true
EOF
#启动Hysteria2
systemctl start hysteria-server.service
#重启Hysteria2
systemctl restart hysteria-server.service
#查看Hysteria2状态
systemctl status hysteria-server.service
#停止Hysteria2
systemctl stop hysteria-server.service
#设置开机自启
systemctl enable hysteria-server.service
#查看日志
journalctl -u hysteria-server.service