164 字 1 分钟阅读
在 Debian12 上快速部署 Gost 作为 Socks5 代理服务器
Gost 是一款 Go 编写的多功能网络代理工具,单二进制即可运行,原生支持 Socks5、HTTP/HTTPS、Relay 等多种协议,常被用作轻量级的代理网关。
下面演示在 Debian12 上部署 Gost 创建一个带认证的 Socks5 代理服务,并通过 systemd 管理使其开机自启。
下载并安装 Gost 到系统目录:
wget https://github.com/go-gost/gost/releases/download/v3.2.6/gost_3.2.6_linux_amd64.tar.gz
tar -xzf gost_3.2.6_linux_amd64.tar.gz
mv gost /usr/local/bin/
创建 systemd 服务文件 /etc/systemd/system/gost.service:
[Unit]
Description=Gost Proxy Service
Documentation=https://gost.run
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/gost -L socks5://<user>:<password>@:8080
Restart=on-failure
RestartSec=5s
StandardOutput=journal
StandardError=journal
ProtectHome=yes
NoNewPrivileges=yes
PrivateTmp=yes
LimitNOFILE=infinity
LimitNPROC=infinity
TasksMax=infinity
[Install]
WantedBy=multi-user.target
启用前请将
<user>、<password>替换为强账号密码,User=root与监听端口8080也可按需调整。
重载 systemd 并设置开机自启:
systemctl daemon-reload
systemctl enable --now gost
确认服务已启动并监听 8080 端口:
ss -tunlp | grep 8080
互动
暂无留言,来做第一个吧。