install(you also can install using apt)
apt-get install python-pip
pip install git+https://github.com/shadowsocks/shadowsocks.git@master
cd /etc
sudo touch shadowsocks.json
Create a config file /etc/shadowsocks.json
. Example:
{
"server":"my_server_ip",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"mypassword",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}
Explanation of the fields:
Name | Explanation |
---|---|
server | the address your server listens |
server_port | server port |
local_address | the address your local listens |
local_port | local port |
password | password used for encryption |
timeout | in seconds |
method | default: "aes-256-cfb", see Encryption |
fast_open | use TCP_FASTOPEN, true / false |
workers | number of workers, available on Unix/Linux |
To run in the foreground:
server use ssserver
local use sslocal
we use sslocal
sslocal -c /etc/shadowsocks.json
To run in the background:
sslocal -c /etc/shadowsocks.json -d start
sslocal -c /etc/shadowsocks.json -d stop
Catch the error when run sslocal -c /etc/shadowsocks.json -d start
INFO: loading config from /etc/shadowsocks.json
2019-04-21 16:03:55 INFO loading libcrypto from libcrypto.so.1.1
2019-04-21 16:03:55 ERROR [Errno 13] Permission denied: '/var/run/shadowsocks.pid'
whereis sslocal
sslocal: /home/ervincheung/.local/bin/sslocal
So run
sudo .local/bin/sslocal -c /etc/shadowsocks.json -d start
sudo .local/bin/sslocal -c /etc/shadowsocks.json -d stop
链接: https://pan.baidu.com/s/1Dai7YZuOKg378sdV_yhD3g 提取码: d7aw
规则列表链接: https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt