搭建翻墙服务器

安装pip

1
2
$ curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
$ python get-pip.py

安装 shadowsocks

1
2
$ pip install --upgrade pip
$ pip install shadowsocks

创建配置文件/etc/shadowsocks.json

1
2
3
4
5
6
7
8
9
10
{
"server":"0.0.0.0",
"local_address": "127.0.0.1",
"local_port":1080,
"port_password":{
"8388":"you can set password here"
},
"timeout":300,
"method":"aes-256-cfb"
}

配置自启动

新建启动脚本文件 /etc/systemd/system/shadowsocks.service

1
2
3
4
5
6
7
8
9
[Unit]
Description=Shadowsocks
[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/ssserver -c /etc/shadowsocks.json
[Install]
WantedBy=multi-user.target

执行以下命令启动 shadosocks 服务:

1
2
$ systemctl enable shadowsocks
$ systemctl start shadowsocks

可以通过以下命令查看服务是否成功启动

1
$ systemctl status shadowsocks -l

防火墙开放shadowsocks服务端口

1
2
firewall-cmd --permanent --add-port=8388/tcp
firewall-cmd --reload