开始前准备
- 熟悉基础 Linux 命令行与 systemd 管理。
- 一份适用于 sing-box 的合法 config.json 配置文件。
一、安装并校验配置文件语法
按照 sing-box 官方文档完成安装并写入 /etc/sing-box/config.json 后,务必先执行一次语法检查再启动守护进程:
sudo sing-box check -c /etc/sing-box/config.json
二、启动服务与查看运行日志
校验通过后使用 systemd 启动服务,并通过 journalctl 观察连接输出:
sudo systemctl enable --now sing-box
sudo journalctl -u sing-box -f