CodeMan

Each of us must find a way to love the world. You have found yours.

0%

Centos Shadowsocks 客户端安装

Shadowsocks客户端安装

1
2
3
4
5
yum -y install epel-release
yum -y install python-pip
pip install shadowsocks
mkdir /etc/shadowsocks
vi /etc/shadowsocks/shadowsocks.json

加入配置:

1
2
3
4
5
6
7
8
9
10
11
{ 
"server":"xxx.xxx.xxx.xxx",
"server_port":993,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"xxx",
"timeout":600,
"method":"chacha20-ietf-poly1305",
"fast_open": false,
"workers": 1
}

启动脚本:

1
vi /etc/systemd/system/shadowsocks.service

内容:

1
2
3
4
5
6
7
8
9
[Unit]
Description=Shadowsocks

[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/sslocal -c /etc/shadowsocks/shadowsocks.json

[Install]
WantedBy=multi-user.target

具体常用操作:

1
2
3
4
systemctl enable shadowsocks.service
systemctl start shadowsocks.service
systemctl status shadowsocks.service
systemctl stop shadowsocks.service

检查shadowsock客户端是否安装正常:

1
2
3

curl --socks5 127.0.0.1:1080 http://httpbin.org/ip

返回结果如下:

1
2
3
4
5

{
"origin": "x.x.x.x" #你的Shadowsock服务器IP
}

安装配置privoxy

安装privoxy

1
2
3
4
5
6
yum install privoxy -y
systemctl enable privoxy
systemctl start privoxy
systemctl status privoxy
systemctl stop privoxy

配置privoxy

1
vi /etc/privoxy/config

修改配置:

1
2
listen-address 127.0.0.1:8118 # 8118 是默认端口,不用改
forward-socks5t / 127.0.0.1:1080 . #转发到本地端口,注意最
1
vi /etc/profile 

加入:

1
2
3
4
5
export http_proxy=http://127.0.0.1:8118
export https_proxy=http://127.0.0.1:8118
export no_proxy=localhost,127.0.0.1

source /etc/profile

测试:

1
curl  cip.cc

ERROR method chacha20-ietf-poly1305 not supported 解决

大部分文章都说按以下命令就能解决这个问题

1
2
3

yum install libsodium -y

然而这样真没什么用,正确的解决办法是重新安装shadowsocks来解决这个问题

1
2
3
4
5
6
7
8
9
10
11
12
pip install https://github.com/shadowsocks/shadowsocks/archive/master.zip -U
Collecting https://github.com/shadowsocks/shadowsocks/archive/master.zip
Downloading https://github.com/shadowsocks/shadowsocks/archive/master.zip (115kB)
100% |████████████████████████████████| 122kB 871kB/s
Installing collected packages: shadowsocks
Found existing installation: shadowsocks 2.8.2
Uninstalling shadowsocks-2.8.2:
Successfully uninstalled shadowsocks-2.8.2
Running setup.py install for shadowsocks ... done
Successfully installed shadowsocks-3.0.0
You are using pip version 8.1.2, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.