shadowsocks-Manual-for-Server-&-Client-Usage
shadowsocks的CLI客户端(sslocal)使用指南
Step1(非必需):
服务端ssserver
安装:
sudo apt install shadowsocks
配置:
启动:sudo systemctl start shadowsocks.service
Step2:
客户端sslocal
安装:
sudo apt install shadowsocks
备份原配置文件:
cp /etc/shadowsocks/config.json{,.original}
配置:
vim /etc/shadowsocks/config.json
示例:
1 | leion@leion-sky:~$ cat /etc/shadowsocks/config.json.ori |
启动 sslocal 进程:
sslocal -c /etc/shadowsocks/config.json &>>/tmp/sslocal.log &
杀掉正在运行的 sslocal 进程:
ps -ef | awk '$9~/sslocal/{print $2}' | xargs kill -9
将该命令放到 ~/.bashrc 以实现用户登录shell后自动启动:
echo 'sslocal -c /etc/shadowsocks/config.json &>>/tmp/sslocal.log &' >> ~/.bashrc
编写 systemd 服务单元脚本:
1 | [Unit] |
1 | sudo systemctl start sslocal.service |
Step3:
验证
curl -x socks5://127.0.0.1:1080 google.com/ncr
返回结果:
1 | leion@leion-sky:~$ curl -x socks5://127.0.0.1:1080 google.com/ncr |