Hugo博客公告弹窗

轻松搭建高效稳定的 Hysteria2 节点服务

   
文章摘要
摘要小助理今天溜号啦……😜

系统

debian/ubuntu

客户端

V2Ray桌面版:https://github.com/2dust/v2rayN/releases

V2Ray安卓端:https://github.com/2dust/v2rayNG/releases

NekoBox安卓端推荐:https://github.com/MatsuriDayo/NekoBoxForAndroid/releases

ClashMeta:https://github.com/MetaCubeX/ClashMetaForAndroid/releases

FlClash:https://github.com/chen08209/FlClash/releases

方法1

为了确保 Hysteria 2 能够正常工作,您需要开放所有 TCP 和 UDP 端口:

sudo ufw allow 1:65535/tcp
sudo ufw allow 1:65535/udp
sudo ufw enable

使用以下命令下载并运行 Hysteria 2 安装脚本:

注意:伪装网址设置为:www.bing.com

配置文件路径:/root/hy

Hysteria 2 一键搭建代码

wget -N --no-check-certificate https://raw.githubusercontent.com/flame1ce/hysteria2-install/main/hysteria2-install-main/hy2/hysteria.sh && bash hysteria.sh

Hysteria 服务相关命令

systemctl start hysteria-server.service    # 启动 hysteria 服务
systemctl enable hysteria-server.service   # 设置 hysteria 服务 开机自启动
systemctl restart hysteria-server.service  # 重启 hysteria 服务
systemctl stop hysteria-server.service     # 停止 hysteria 服务
systemctl status hysteria-server.service   # 查看 hysteria 服务 状态

复制订阅链接

cat /root/hy/url.txt

Windows配置v2ray

设置Core类型:sing_box

image-20240901232034646

方法2

项目:https://github.com/jonssonyan/h-ui

文档:https://github.com/jonssonyan/h-ui/blob/main/README_ZH.md

注意:密码不能有特殊字符

配置文件路径:/usr/local/h-ui

证书路径:/h-ui/bin (如果是docker方式安装,证书路径放在/h-ui/bin)

安装:

mkdir -p /usr/local/h-ui/
curl -fsSL https://github.com/jonssonyan/h-ui/releases/latest/download/h-ui-linux-amd64 -o /usr/local/h-ui/h-ui && chmod +x /usr/local/h-ui/h-ui
curl -fsSL https://raw.githubusercontent.com/jonssonyan/h-ui/main/h-ui.service -o /etc/systemd/system/h-ui.service
# 自定义 Web 端口,默认 8081
# sed -i "s|^ExecStart=.*|ExecStart=/usr/local/h-ui/h-ui -p 8081|" "/etc/systemd/system/h-ui.service"
systemctl daemon-reload
systemctl enable h-ui
systemctl restart h-ui

查看状态

systemctl status h-ui

关闭防火墙

ufw disable

默认安装信息

  • 面板端口: 8081
  • 用户名/密码: sysadmin

若无域名,生成自签证书

openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) -keyout /h-ui/bin/server.key -out /h-ui/bin/server.crt -subj "/CN=bing.com" -days 36500 && sudo chown hysteria /h-ui/bin/server.key && sudo chown hysteria /h-ui/bin/server.crt

证书路径:

/h-ui/bin/server.crt

/h-ui/bin/server.key

卸载

systemctl stop h-ui
rm -rf /etc/systemd/system/h-ui.service /usr/local/h-ui/

优化,定时重启服务器

0 6 * * * /sbin/reboot

安装视频教程:

CC BY-NC-SA 4.0 转载请注明
最后更新于 2024-11-20 16:13
clarity统计