众所周知,在国内无论是想使用 Google 搜索还是上 YouTube 看视频又或者是使用 Twitter、Facebook 等社交平台简直是难上加难,在这里,仅介绍受众最为广泛的 Shadowsocks 搭建教程。

1 使用脚本一键安装 Shadowsocks

连接服务器,输入以下代码:

$ apt update
$ apt upgrade
$ wget --no-check-certificate -O shadowsocks.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh && chmod +x shadowsocks.sh && ./shadowsocks.sh 2>&1 | tee shadowsocks.log

进入安装界面,其中加密方式建议选择 aes-256-gcm 或 chacha20-ietf-poly1305:

...

Please enter password for shadowsocks-python
(Default password: teddysun.com):{password}

---------------------------
password = {password}
---------------------------

Please enter a port for shadowsocks-python [1-65535]
(Default port: 13127):{port}

---------------------------
port = {port}
---------------------------

Please select stream cipher for shadowsocks-python:
1) aes-256-gcm
2) aes-192-gcm
3) aes-128-gcm
4) aes-256-ctr
5) aes-192-ctr
6) aes-128-ctr
7) aes-256-cfb
8) aes-192-cfb
9) aes-128-cfb
10) camellia-128-cfb
11) camellia-192-cfb
12) camellia-256-cfb
13) chacha20-ietf-poly1305
14) chacha20-ietf
15) chacha20
16) rc4-md5
Which cipher you'd select(Default: aes-256-gcm):1

---------------------------
cipher = aes-256-gcm
---------------------------


Press any key to start...or Press Ctrl+C to cancel

之后开始安装,几分钟后便可安装完成,如下:

Congratulations, Shadowsocks-python server install completed!
Your Server IP        :  {ip_address}
Your Server Port      :  {port}
Your Password         :  {password} 
Your Encryption Method:  aes-256-gcm

Welcome to visit:https://teddysun.com/342.html
Enjoy it!

2 开启 BBR 加速

BBR 是 Google 开源的一套内核加速算法,可以让你搭建的 Shadowsocks 速度得到进一步提升,建议开启。不过按照以上步骤安装时一般就已经完成了 BBR 的开启,可以输入以下代码检查:

$ sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = reno cubic bbr

如果输出结果中包含 bbr,则代表 BBR 已经开启,否则可以参考 → Ubuntu 快速开启 Google BBR 方法 开启

3 客户端的下载与配置