Shadowsocks-Python 版一键安装脚本是秋水逸冰开发并维护的一个一键安装 Shadowsocks-Python 的脚本,Shadowsocks-Python 版就是我们通常说的原版 SS,该脚本支持所有主流的 Linux 系统,支持一键设定端口、密码、加密方式等,是一个非常方便的 Shadowsocks-Python 脚本。
1、代理服务器购买
代理服务器推荐:国外科学上网翻墙 VPS 服务器推荐,新手买哪个好?
搬瓦工官网:
搬瓦工购买与优惠码使用可以参考:搬瓦工购买教程,支持支付宝和微信支付,终身优惠码。
VULTR 官网:
VULTR 也支持支付宝和微信支付,购买教程:VULTR 购买教程,支持支付宝与微信支付,中文图解教程。
购买完 VPS 后,只需要通过 Xshell 连接 VPS 即可操作 VPS,包括安装脚本、加速等:利用免费版 Xshell 远程连接你的 Linux VPS,含 Xshell 下载。
2、脚本介绍
关于脚本 shadowsocks.sh:
- Python 版 Shadowsocks 就是我们常说的 SS,它是原版的 SS,其他分支还有 Go 版本,libev 版本;
- 一键安装 Python 版的 Shadowsocks 服务器;
- 支持自定义配置:服务器端口:自己设定(如不设定,默认从 9000-19999 之间随机生成);密码:自己设定(如不设定,默认为 teddysun.com);加密方式:自己设定(如不设定,默认为 aes-256-gcm)。
Shadowsocks-Python 版一键安装脚本支持系统包括 CentOS 6+,Debian 7+,Ubuntu 12+。
3、脚本使用
在 VPS 上依次执行以下命令:
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh chmod +x shadowsocks.sh ./shadowsocks.sh 2>&1 | tee shadowsocks.log
之后会需要你手动输入 SS 服务器信息,包括密码、端口、加密方式如果不设置,脚本会有默认值(具体参考上一部分的脚本介绍):
设置好配置后,脚本会一键安装 SS 服务器端,等待安装完成后,提示如下:
Congratulations, shadowsocks install completed! Your Server IP:your_server_ip Your Server Port:your_server_port Your Password:your_password Your Local IP:127.0.0.1 Your Local Port:1080 Your Encryption Method:aes-256-cfb Welcome to visit:http://teddysun.com/342.html Enjoy it!
4、脚本其他设置
1.脚本卸载
一键卸载 SS 服务器以及配置文件:
./shadowsocks.sh uninstall
2.脚本使用命令与配置文件
启动:/etc/init.d/shadowsocks start 停止:/etc/init.d/shadowsocks stop 重启:/etc/init.d/shadowsocks restart 状态:/etc/init.d/shadowsocks status 配置文件路径:/etc/shadowsocks.json 日志文件路径:/var/log/shadowsocks.log
3. SS 多用户配置
如果需要配置 SS 多用户,那么需要修改配置文件 /etc/shadowsocks.json
,示例如下,下面的配置文件表示有5个用户,port_password
对应的是5个用户的端口和密码,修改完配置文件后,用 /etc/init.d/shadowsocks restart
命令重启 SS 服务端生效:
{ "server":"0.0.0.0", "local_address":"127.0.0.1", "local_port":1080, "port_password":{ "8989":"password0", "9001":"password1", "9002":"password2", "9003":"password3", "9004":"password4" }, "timeout":300, "method":"aes-256-cfb", "fast_open": false }
4.查看 SS 连接人数
首先需要安装 lsof,Ubuntu 和 CentOS 的安装方式如下,之后可以查看 SS 连接数与连接列表:
# Ubuntu 系统执行如下命令 apt-get install lsof -y # CentOS 系统执行如下命令 yum install lsof -y # 假设服务器端口1080, 查看连接数 sudo lsof -i -n -P | egrep -c ':1080.+ESTABLISHED' # 查看连接列表 sudo lsof -i -n -P | egrep ':1080.+ESTABLISHED'