20240229——VPN相关
1 登录链接
https://auua.sbs?uuid=ac62d908-e2e2-4766-a3f3-eb5c44824f3c&hmac=14b549dadacf4b9f95800aa4bfc5151ebee7bc63a3eb767e0c6a6f51c7819720
bash <(curl -ksSL https://repo.o2cdn.icu/cached-apps/sing-box/singbox.sh || curl -ksSL https://mirror.ghproxy.com/https://raw.githubusercontent.com/caocaocc/installers/main/singbox.sh) “https://sync.xn–8stx8olrwkucjq3b.com/v1/service/10388867?hmac=05147C5FB8677D8B0011E46661352704C345D6E19D8AC0647748F6DE45CC693E&lang=&templateId=24”
2 Linux自启动
# 新建以下文件
sudo gedit /etc/systemd/system/sing-box.service
新版本的sing-box可能提示找不到配置文件的错误,所以我修改了启动选项 sing-box run -c config.txt -D ./
[Unit]
Description=sing-box service
Documentation=https://sing-box.sagernet.org
After=network.target nss-lookup.target
[Service]
User=root
Group=root
WorkingDirectory=/home/lieryang/.local/share/sing-box
ExecStart=/home/lieryang/.local/bin/sing-box run -c config.txt -D ./
Restart=on-failure
RestartSec=10s
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target
-
修改配置文件后需要重载配置文件:
systemctl daemon-reload
-
管理服务:
- 启动 sing-box 服务并启用开机启动:
systemctl enable --now sing-box
-
停止 sing-box 服务并禁用开机启动:
systemctl disable --now sing-box
-
重启 sing-box 服务:
systemctl restart sing-box
- 实时滚动显示 sing-box 的最新日志:
journalctl -u sing-box --output cat -f
- 启动 sing-box 服务并启用开机启动: