一键安装 Shadowsocks 脚本

脚本适用环境
支持的系统:CentOS 6+,Debian 7+,Ubuntu 12+
内存需求:≥128M
发布日期:2017 年 07 月 27 日
脚本介绍
1. 本脚本可一键安装 Shadowsocks-Python,ShadowsocksR,Shadowsocks-Go,或 Shadowsocks-libev 其中一种服务端;
2. 各版本的启动脚本与配置文件名称不再重复;
3. 每次运行时只能安装一种版本;
4. 支持多次运行以安装多个版本,各版本可共存(注意设置不同的端口号);
5. 如果已安装多个版本,卸载时也需逐个进行(每次卸载一种);
6. Shadowsocks-Python 和 ShadowsocksR 无法同时启动(因为它们都属于 Python 版本)。
温馨提示:如有疑问,请先查阅《Shadowsocks 故障排除》后再进行咨询。
默认配置
服务器端口:用户自定义(未设置时默认为 8989)
密码:用户自定(未设置时默认为 teddysun.com)
加密方式:用户自定义(未设置时,Python 和 libev 版本默认为 aes-256-gcm,R 和 Go 版本默认为 aes-256-cfb)
协议(protocol):用户自定义(未设置时,默认为 origin,仅限于 ShadowsocksR 版本)
混淆(obfs):用户自定义(未设置时,默认为 plain,仅限于 ShadowsocksR 版本)
备注:脚本默认创建单用户配置文件,若需多用户配置,请手动修改配置文件并重启。
客户端下载
Windows 客户端(常规版)
https://github.com/shadowsocks/shadowsocks-windows/releases
Windows 客户端(ShadowsocksR 版)
https://github.com/shadowsocksr/shadowsocksr-csharp/releases
使用说明
请以 root 用户身份登录并运行以下命令:
wget --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
完成安装后提示
Congratulations, 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 Welcome to visit:https://teddysun.com/486.html Enjoy it!
卸载说明
如果安装了多个版本,卸载时需逐个进行(每次卸载一种)
请以 root 用户身份登录并运行以下命令:
./shadowsocks-all.sh uninstall
启动脚本
启动脚本的参数依次为:启动、停止、重启、查看状态。
Shadowsocks-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
各版本默认配置文件
Shadowsocks-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
更新日志
2017 年 07 月 27 日:
1. 新增:ShadowsocksR 版本支持选择协议(protocol)auth_chain_b。使用该协议需要更新到最新(4.7.0)ShadowsocksR 客户端;
2. 修改:更新 ShadowsocksR 源码下载地址。
2017 年 07 月 23 日:
1. 修正:卸载时可选择特定版本,若该版本不存在则报错退出。
2017 年 07 月 22 日:
1. 修正:默认加密方式从 aes-256-cfb 改为 aes-256-gcm(Python 和 libev 版本);
2. 新增:安装时可选 16 种加密方式中的任意一种(Python 和 libev 版本)。可选方式如下:
aes-256-gcm aes-192-gcm aes-128-gcm aes-256-ctr aes-192-ctr aes-128-ctr aes-256-cfb aes-192-cfb aes-128-cfb camellia-128-cfb camellia-192-cfb camellia-256-cfb chacha20-ietf-poly1305 chacha20-ietf chacha20 rc4-md5
3. 新增:安装时可选 9 种加密方式中的任意一种(Go 版本)。可选方式如下:
aes-256-cfb aes-192-cfb aes-128-cfb aes-256-ctr aes-192-ctr aes-128-ctr chacha20-ietf chacha20 rc4-md5
4. 新增:安装时可选 13 种加密方式中的任意一种(none 表示不加密,适用于 ShadowsocksR 版本)。可选方式如下:
none aes-256-cfb aes-192-cfb aes-128-cfb aes-256-cfb8 aes-192-cfb8 aes-128-cfb8 aes-256-ctr aes-192-ctr aes-128-ctr chacha20-ietf chacha20 rc4-md5 rc4-md5-6
5. 新增:安装时可选 7 种协议(protocol)中的任意一种(仅适用于 ShadowsocksR 版本)。可选方式如下:
origin verify_deflate auth_sha1_v4 auth_sha1_v4_compatible auth_aes128_md5 auth_aes128_sha1 auth_chain_a auth_chain_b
6. 新增:安装时可选 9 种混淆(obfs)中的任意一种(仅适用于 ShadowsocksR 版本)。可选方式如下:
plain http_simple http_simple_compatible http_post http_post_compatible tls1.2_ticket_auth tls1.2_ticket_auth_compatible tls1.2_ticket_fastauth tls1.2_ticket_fastauth_compatible
2017 年 02 月 24 日:
1. 恢复:通过 Github API 自动获取 Shadowsocks-libev 最新发布版本的功能(v3.0.3)。
2017 年 02 月 13 日:
1. 升级:Shadowsocks-libev 版本更新至 3.0.2;
2. 升级:Shadowsocks-go 版本更新至 1.2.1(基于 Github 最新代码编译的 x86 和 x86_64 二进制文件);
3. 修复:在 Debian 7 下默认缺少 libudns-dev 依赖包的问题。
2017 年 02 月 12 日:
1. 升级:Shadowsocks-libev 版本更新至 3.0.1。
2017 年 01 月 27 日:
1. 升级:Shadowsocks-go 版本更新至 1.2.1(仅适用于 x86_64 系统)
其他 Shadowsocks 服务端一键安装脚本
Shadowsocks Python 版一键安装脚本(适用于 CentOS,Debian,Ubuntu)
ShadowsocksR 版一键安装脚本(适用于 CentOS,Debian,Ubuntu)
CentOS 下的 Shadowsocks-libev 一键安装脚本
Debian 下的 Shadowsocks-libev 一键安装脚本
Shadowsocks-go 一键安装脚本(适用于 CentOS,Debian,Ubuntu)
注意:上述单版本不可与该四合一版本混用。

