VPN技术 · 2023年11月10日 0

CentOS一键安装shadowsocks-libev脚本

CentOS一键安装shadowsocks-libev脚本

CentOS一键安装shadowsocks-libev脚本

适用环境:
系统要求:CentOS
内存要求:≥128M
日期:2017年07月22日

脚本简介:
该脚本用于一键安装最新版本的libev版Shadowsocks。其主要特点是内存占用小(约600k),CPU消耗低,甚至可以在基于OpenWRT的路由器上运行。如遇问题,请先查看《Shadowsocks Troubleshooting》。

默认设置:
服务器端口:可自定义(默认为8989)
密码:可自定义(默认为teddysun.com)
加密方式:可自定义(默认为aes-256-gcm)

Windows客户端下载:
https://github.com/shadowsocks/shadowsocks-windows/releases

安装步骤:
使用root用户登录,执行以下命令:

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

安装完成后,将显示如下信息:

Congratulations, Shadowsocks-libev server 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/357.html Enjoy it!

卸载步骤:
使用root用户登录,执行以下命令:

./shadowsocks-libev.sh uninstall

其它信息:
客户端配置参考链接:https://teddysun.com/339.html

安装后,Shadowsocks-libev会自动在后台启动。可通过以下命令检查进程状态:

/etc/init.d/shadowsocks status

脚本安装完成后,会将Shadowsocks-libev添加到开机自启动中。

操作命令:
启动:/etc/init.d/shadowsocks start
停止:/etc/init.d/shadowsocks stop
重启:/etc/init.d/shadowsocks restart
查看状态:/etc/init.d/shadowsocks status

更多版本安装:
ShadowsocksR版一键安装脚本(CentOS,Debian,Ubuntu)
Shadowsocks Python版一键安装脚本(CentOS,Debian,Ubuntu)
Debian下Shadowsocks-libev一键安装脚本
Shadowsocks-go一键安装脚本(CentOS,Debian,Ubuntu)

更新日志

2017年07月22日:
1、修正:默认加密方式由aes-256-cfb改为aes-256-gcm(官方原版客户端支持该加密方式);
2、新增:安装时可选16种加密方式,具体如下:

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

2017年02月24日:
1、恢复:通过Github API自动获取Shadowsocks-libev的最新release版本功能(v3.0.3)。

2017年02月13日:
1、更新:升级版本到3.0.2。

2017年02月12日:
1、更新:升级版本到3.0.1(请下载最新脚本进行安装)。

2016年11月05日:
1、新增:判断是否已安装,若已安装则获取版本号与最新版比较,支持升级覆盖安装;
2、修正:未安装时获取最新版本号的问题。

2016年09月23日:
1、修正:偶尔自动获取版本号失败的问题;
2、新增:自动判断VPS是否存在IPv6地址,并在配置文件中添加监听IPv6地址。

2016年09月17日:
1、重构代码,自动获取Github上最新版进行安装,免去手动修改版本号;
2、自动检测本机是否已安装,若已安装则正常退出(如需安装新版,需先卸载);
3、改为下载tar.gz包安装,无需依赖unzip命令。

2016年09月12日:
1、更新:升级版本到2.5.2。

2016年09月11日:
1、更新:升级版本到2.5.1。

2016年08月29日:
1、更新:升级版本到2.5.0;
2、修正:由于安装时文件名更新,卸载时文件名需保持一致。

2016年07月14日:
1、更新:升级版本到2.4.7。

2016年07月05日:
1、修正:新增依赖xmlto、asciidoc;
2、修正:因安装时文件名更新,卸载时文件名需保持一致。

2016年05月12日:
1、新增:设置CentOS 7下的防火墙规则。

2015年08月01日:
1、新增:自定义服务器端口功能(如不设定,默认为8989)。

2015年04月30日:
1、修正:配置文件 /etc/shadowsocks-libev/config.json 同时启用IPv4与IPv6支持:

{     "server":["[::0]","0.0.0.0"],     "server_port":your_server_port,     "local_address":"127.0.0.1",     "local_port":1080,     "password":"your_password",     "timeout":600,     "method":"aes-256-cfb" }

2、Shadowsocks libev版不支持通过修改配置文件进行多端口(只能开启多进程),如需多端口请安装Python或Go版;

特别说明:
1、如需升级已安装的旧版本shadowsocks,请下载本脚本的最新版并直接运行即可自动升级。

./shadowsocks-libev.sh

参考链接:
https://github.com/shadowsocks/shadowsocks-libev