ShadowSocks

@bingoogolapple 2017-08-12 16:54:32发表于 bingoogolapple/bingoogolapple.github.io DockerLinux工具软件开发环境

Centos 安装 ShadowSocks

安装 ShadowSocks

  • 更新 yum
sudo yum update
  • 安装 pip
yum install python-setuptools && easy_install pip
  • 安装 ShadowSocks
pip install shadowsocks

启动 ShadowSocks

  • 新建配置文件「vim 」
{
    "server":"0.0.0.0",
    "local_address": "127.0.0.1",
    "local_port":本地端口号,
    "port_password":{
    	"客户端连接时的端口号1":"密码1",
    	"客户端连接时的端口号2":"密码2",
    	"客户端连接时的端口号2":"密码3"
    },
    "timeout":300,
    "method":"rc4-md5",
    "fast_open": true
}
  • 增加别名快捷启动「vim ~/.bashrc」追加如下内容
alias startss='ssserver -c /etc/shadowsocks.json -d start'
alias stopss='ssserver -c /etc/shadowsocks.json -d stop'
  • source ~/.bashrc
  • 启动 startss
  • 停止 stopss
  • 查看日志 sudo less /var/log/shadowsocks.log
  • 开机启动 vim /etc/rc.local
sudo ssserver -c /etc/shadowsocks.json -d start

配置自启动

  • vim /etc/systemd/system/shadowsocks.service
[Unit]
Description=Shadowsocks
[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/sslocal -c /etc/shadowsocks.json
[Install]
WantedBy=multi-user.target
  • 启动 Shadowsocks 服务
systemctl enable shadowsocks.service
systemctl start shadowsocks.service
systemctl status shadowsocks.service