传统运维 - ss5代理

2022-06-25

安装python3

yum install -y python3-pip

安装shadowsocks

pip3 install https://github.com/shadowsocks/shadowsocks/archive/master.zip

ssserver --version

创建配置文件

# vim /etc/shadowsocks.conf
{
  "server": "0.0.0.0",
  "local_address": "127.0.0.1",
  "local_port": 1080,
  "port_password": {
    "8081": "StVYa2ln9KQTgPw"
  },
  "timeout": 600,
  "method": "aes-256-cfb"
}

安装supervisor

yum install -y supervisor

supervisor管理

# vim /etc/supervisord.d/ssserver.ini
[program:ssserver]
user=root
command=/usr/bin/python3 /usr/local/bin/ssserver -c /etc/shadowsocks.conf
autostart=true
startsecs=1
autorestart=true
startretries=30
stderr_logfile=/var/log/supervisor/ssserver-err.log
stdout_logfile=/var/log/supervisor/ssserver-out.log
stopsignal=INT

[supervisord]


# vim /etc/supervisord.d/sslocal.ini
[program:sslocal]
user=root
command=/usr/bin/python3 /usr/local/bin/sslocal -s 127.0.0.1 -p 8081 -b 0.0.0.0 -l 8082 -k StVYa2ln9KQTgPw -t 600 -m aes-256-cfb
autostart=true
startsecs=1
autorestart=true
startretries=30
stderr_logfile=/var/log/supervisor/sslocal-err.log
stdout_logfile=/var/log/supervisor/sslocal-out.log
stopsignal=INT

[supervisord]

启动应用

systemctl enable supervisord && systemctl restart supervisord

测试

curl --socks5 ${ip}:8082 cip.cc