Posted on 12 Nov 2020
服务端
客户端
- 配置epel源
$ yum -y install epel-release
- 安装python-pip
$ yum install python-pip
- 安装shadowsocks
$ pip install shadowsocks
- 创建shadowsocks配置文件
$ vi /etc/ss.json { "server":"***.***.***.***", # ss服务器ip "server_port":****, # ss服务器端口 "local_address": "127.0.0.1", # 本地机器ip "local_port":1080, # 本地机器端口 "password":"*****", # 密码 "timeout":300, "method":"aes-256-cfb", # 加密方式 "fast_open": false }
- 配置本地shadowsocks自启动
$ vi /etc/systemd/system/ss.service [Unit] Description=Shadowsocks [Service] TimeoutStartSec=0 ExecStart=/usr/bin/sslocal -c /etc/ss.json [Install] WantedBy=multi-user.target
- 启动shadowsocks客户端
systemctl enable ss systemctl start ss systemctl status ss
- 验证
# 验证shadowsocks客户端是否正常运行,正常会返回你的代理IP curl --socks5 127.0.0.1:1080 http://httpbin.org/ip
- 安装配置privoxy
$ yum install -y privoxy
Shadowsocks是一个socket5服务,我们需要使用privoxy把流量转到http/https上
- 配置privoxy
$ vi /etc/privoxy/config listen-address 127.0.0.1:8118 forward-socks5t / 127.0.0.1:1080
- 修改/etc/profile
$ vi /etc/profile export http_proxy=http://127.0.0.1:8118 export https_proxy=http://127.0.0.1:8118 $ source /etc/profile
- 验证
$ curl www.google.com
如果可以正常返回内容,即表示配置成功