输入以下内容,创建 Shadowsocks 配置文件 /etc/shadowsocks.json:
1 | { |
使用以下命令启动服务:
1 | sudo sslocal -c /etc/shadowsocks.json & |
下面开始配置 privoxy 做全局代理:
1 | sudo vi /etc/privoxy/config |
找到并修改以下配置:
1 | listen-address 127.0.0.1:8118 |
去掉注释,保证端口 8118 不与系统变量冲突即可,可自由设定。
找到并修改:
1 | forward-socks5t / 127.0.0.1:1080 . |
去掉注释,要求和 ss 端口号相同,注意最后一位英文句号不可丢!
保存并退出即可。
执行:
1 | sudo privoxy /etc/privoxy/config |
无报错则正确启动。
Shell 下使用 http 代理需执行:
1 | export http_proxy=http://127.0.0.1:8118 |
运行 w3m www.google.com 可访问则说明代理已配置成功。
Fedora & RHEL
Supported distributions:
- Recent Fedora versions (until EOL)
- RHEL 6, 7 and derivatives (including CentOS, Scientific Linux)
Build from source with CentOS
If you are using CentOS 7, you need to install these prerequirements to build from source code:
1 | yum install epel-release -y |
ArchLinux / Manjaro
1 | bash <(curl -sL https://raw.githubusercontent.com/hijkpw/scripts/master/centos_install_ss.sh) |