Skip to content

imengying/sing-box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 

Repository files navigation

sing-box 一键脚本(VLESS + Reality)

用于快速安装、更新、查看和卸载 sing-box 服务端。

功能

  • 一键安装 sing-box(自动生成 UUID、Reality 密钥、配置文件)
  • 一键更新 sing-box
  • 一键更新配置(保留 UUID / 端口 / 私钥)
  • 查看当前配置和服务状态
  • 一键卸载
  • 支持 systemd / OpenRC

支持环境

  • 发行版:Debian/Ubuntu、RHEL/Fedora/CentOS 8+、Alpine
  • 架构:x86_64、i386/i686、ARM(v5/v6/v7/v8)、ARM64、LoongArch64、MIPS、PPC64LE、RISC-V64、s390x

快速使用

需要 root 权限:

bash <(curl -fsSL "https://raw.githubusercontent.com/imengying/sing-box/main/sing-box.sh")

菜单功能

直接运行主脚本将进入交互式菜单:

  1. 安装 sing-box
  2. 更新 sing-box
  3. 更新配置文件
  4. 查看配置信息
  5. 查看服务状态
  6. 卸载 sing-box

命令行参数

除了交互式菜单,脚本也支持直接通过命令行参数执行对应功能,适合自动化部署(需要 root 权限):

  • installi:安装 sing-box
  • updateu:更新 sing-box
  • configc:更新配置文件
  • info:查看配置信息
  • statuss:查看服务状态
  • uninstall:卸载 sing-box
  • -y--auto:自动模式(跳过确认;非交互环境推荐)

默认模式下会进行必要交互(例如安装时端口输入、IPv4/IPv6 选择,IP 版本默认 v6)。

例如直接更新:

curl -fsSL "https://raw.githubusercontent.com/imengying/sing-box/main/sing-box.sh" | bash -s -- update

更新方式

推荐直接运行主脚本:

bash <(curl -fsSL "https://raw.githubusercontent.com/imengying/sing-box/main/sing-box.sh")

然后在菜单中选择 2,或使用命令行参数 update 直接更新。

常用服务命令

systemd:

systemctl status sing-box
systemctl restart sing-box
journalctl -u sing-box -f

OpenRC:

rc-service sing-box status
rc-service sing-box restart

文件路径

  • 配置文件:/etc/sing-box/config.json
  • 执行文件:/etc/sing-box/sing-box
  • 公钥文件:/etc/sing-box/public.key

VLESS 链接格式

vless://<UUID>@<IP>:<PORT>?encryption=none&flow=xtls-rprx-vision&security=reality&sni=updates.cdn-apple.com&fp=firefox&pbk=<PublicKey>#VLESS-REALITY

IPv6 地址请使用 [] 包裹,例如:[2211:db8::1]

About

Sing-box 服务端一键安装与管理脚本。支持 VLESS + Reality 协议,兼容 Systemd/OpenRC 及多架构 Linux 系统。

Resources

Stars

Watchers

Forks

Contributors

Languages