本文主要参考了神机(花姐)Surge | 部署 Snell Server – DivineEngine | Site,只是根据自己搭建过程做了一点点改动。感谢花姐以及surge pro群里热心指导的各位。
sudo -i
获取管理权限
sudo apt update && sudo apt install wget unzip
sudo dnf install unzip
apt install vim
如果你的服务器是其它版本的去官网Snell Protocol · GitBook下载相应服务器版本。这里以linux-amd64为例
wget https://dl.nssurge.com/snell/snell-server-v4.0.1-linux-amd64.zip
如果ARM的机器:
wget https://dl.nssurge.com/snell/snell-server-v4.0.1-linux-aarch64.zip
AMD
sudo unzip snell-server-v4.0.1-linux-amd64.zip -d /usr/local/bin
ARM
sudo unzip snell-server-v4.0.1-linux-aarch64.zip -d /usr/local/bin
chmod +x /usr/local/bin/snell-server
sudo mkdir /etc/snell
sudo snell-server --wizard -c /etc/snell/snell-server.conf
sudo vim /etc/snell/snell-server.conf
[snell-server]
listen = 0.0.0.0:11807
psk = AijHCeos15IvqDZTb1cJMX5GcgZzIVE
ipv6 = false
listen:监听地址及端口; psk:密钥; ipv6:如果需要 IPv6 支持将值为 – true;
sudo vim /lib/systemd/system/snell.service
[Unit]
Description=Snell Proxy Service
After=network.target
[Service]
Type=simple
User=nobody
Group=nogroup
LimitNOFILE=32768
ExecStart=/usr/local/bin/snell-server -c /etc/snell/snell-server.conf
AmbientCapabilities=CAP_NET_BIND_SERVICE
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=snell-server
[Install]
WantedBy=multi-user.target
然后使用命令:
sudo systemctl daemon-reload
sudo systemctl enable snell
sudo systemctl start snell
sudo systemctl stop snell
sudo systemctl status snell
如果要查看自己Snell配置:
cat /etc/snell/snell-server.conf
查看后将相应的配置输出到surge里面:
格式如下:(XXX.XXX.XXX.XXX换成你自己的vps IP,端口和psk也是自己改成自己设置的snell-server.conf里面相应数据。)
AWS-EC2-SG = snell, XXX.XXX.XXX.XXX, 11807, psk=AijHCeos15IvqDZTb1cJMX5GcgZzIVE, version=4, tfo=true
中午我是自己在 AWS -EC2 上按照这个步骤自己来了一遍并通了的。
如果你看完教程觉得好麻烦啊我不想动手搞,那么这个一键脚本应该可以帮到你
wget -O snell.sh --no-check-certificate https://raw.githubusercontent.com/getsomecat/Snell/master/snell_new.sh && chmod +x snell.sh && ./snell.sh