本文为自用Shadowsocks配置的备忘教程。
1. SS配置
1.1 一键安装(Python版):
1 | wget --no-check-certificate -O shadowsocks.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh |
如出现错误提示“bash: wget: command not found”。可以请在先执行yum -y install wget
命令
接着按照提醒输入你的密码,端口和加密方式(aes-256-cfb)。
2. SSR配置
2.1 一键部署ssr
1 | yum -y install wget |
调出界面:
1 | bash ssr.sh |
3. BBR配置
3.1 OpenVZ 以外的,比如 KVM、Xen、VMware等
- 使用root用户登录,运行以下命令:
1
wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh
- 安装完成后,脚本会提示需要重启 VPS,输入 y 并回车后重启。
重启完成后,进入 VPS,验证一下是否成功安装最新内核并开启 TCP BBR,输入以下命令:1
uname -r
- 查看内核版本,显示为最新版就表示 OK 了返回值一般为:
1
sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = bbr cubic reno
或者为:
net.ipv4.tcp_available_congestion_control = reno cubic bbr
1 | sysctl net.ipv4.tcp_congestion_control |
返回值一般为:
net.ipv4.tcp_congestion_control = bbr
1 | sysctl net.core.default_qdisc |
返回值一般为:
net.core.default_qdisc = fq
1 | lsmod | grep bbr |
返回值有 tcp_bbr 模块即说明 bbr 已启动。注意:并不是所有的 VPS 都会有此返回值,若没有也属正常。
3.2 搬瓦工OpenVZ 平台 Google BBR 一键安装脚本
1 | wget https://raw.githubusercontent.com/kuoruan/shell-scripts/master/ovz-bbr/ovz-bbr-installer.sh |
4. Shadowsocks 一键安装脚本(四合一)
安装:
1
2
3wget --no-check-certificate -O shadowsocks-all.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-all.sh
chmod +x shadowsocks-all.sh
./shadowsocks-all.sh 2>&1 | tee shadowsocks-all.log安装完成后,脚本提示如下
1
2
3
4
5
6
7
8
9
10
11
12
13Congratulations, your_shadowsocks_version install completed!
Your Server IP :your_server_ip
Your Server Port :your_server_port
Your Password :your_password
Your Encryption Method:your_encryption_method
Your QR Code: (For Shadowsocks Windows, OSX, Android and iOS clients)
ss://your_encryption_method:your_password@your_server_ip:your_server_port
Your QR Code has been saved as a PNG file path:
your_path.png
Welcome to visit:https://teddysun.com/486.html
Enjoy it!卸载方法
若已安装多个版本,则卸载时也需多次运行(每次卸载一种)
使用root用户登录,运行以下命令:1
./shadowsocks-all.sh uninstall
启动脚本
启动脚本后面的参数含义,从左至右依次为:启动,停止,重启,查看状态。1
2
3
4
5
6
7
8
9
10
11Shadowsocks-Python 版:
/etc/init.d/shadowsocks-python start | stop | restart | status
ShadowsocksR 版:
/etc/init.d/shadowsocks-r start | stop | restart | status
Shadowsocks-Go 版:
/etc/init.d/shadowsocks-go start | stop | restart | status
Shadowsocks-libev 版:
/etc/init.d/shadowsocks-libev start | stop | restart | status各版本默认配置文件
1
2
3
4
5
6
7
8
9
10
11Shadowsocks-Python 版:
/etc/shadowsocks-python/config.json
ShadowsocksR 版:
/etc/shadowsocks-r/config.json
Shadowsocks-Go 版:
/etc/shadowsocks-go/config.json
Shadowsocks-libev 版:
/etc/shadowsocks-libev/config.json
5. simple-obfs混淆客户端设置
下载 obfs-local.zip:
https://github.com/shadowsocks/simple-obfs/releases
下载后,解压出来的文件一定要和 Windows 客户端的 exe 文件放在同一文件夹下
插件程序:obfs-local
插件选项:obfs=http;obfs-host=www.bing.com (http混淆时,网址随便写国内能访问到的)