开源项目地址:https://github.com/shadowsocks/
shadowsocks下载链接
https://github.com/shadowsocks/shadowsocks/wiki/Ports-and-Clients#windows
准备工作:服务器VPS必须拥有独立IP 系统选择Debian / Ubuntu / CentOS 必须要开启对应的服务器端口号,比如默认将8388作为Shadowsocks服务器端口的话,就必须同时把TCP 8388和UDP8388这2个都开放,依此类推,设定哪个端口作为Shadowsocks服务器端口的话同时将TCP协议和UDP协议的终结点都开启,不然的话就算配置正确也无法正常使用。
Debian / Ubuntu系统运行以下命令:
apt-get install python-pip
pip install shadowsocksCentOS系统运行以下命令:
yum install python-setuptools && easy_install pip
pip install shadowsocks中间只需要按【enter】回车确认即可完成安装。安装后创建配置文件,运行以下命令vi /etc/shadowsocks.json按【i】键进入插入模式,然后一次性完整复制以下代码{
"server":"0.0.0.0",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"mypassword",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}注释:【mypassword】修改为自己所设置的密码接下来按【Esc】退出编辑模式再按【:】输入【wq】保存并退出编辑模式,再运行以命令启动Shadowsocks并后台运行该服务
ssserver -c /etc/shadowsocks.json -d start至此Shadowsocks服务器端就算配置完成了,如果不出意外的话,客户端应该就能成功连上了【注意】每次系统重启后都必须用putty登陆并再次重新运行ssserver -c /etc/shadowsocks.json -d start来开启它。以上为官方原汁原味的配置方法,缺点就是不能自启。
网上有很多人说可以将shadowsocks-libev编译的方法来安装就能实现自动启动,怪小编不才,总是出现这或那的错误,最终还是失败了,还是不能自启。最后发现有
==========以下安装方法可以实现Shadowsocks开机自动启动====
系统支持:CentOS 32或64位
内存要求:≥128M
服务器端口:8989
客户端端口:1080
密码:自己设定(如不设定,默认为teddysun.com)
参考地址:http://teddysun.com/357.html
使用方法:
使用root用户登录,运行以下命令:
wget --no-check-certificate 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安装完成后即已后台启动 shadowsocks ,运行:
ps -ef | grep ss-server | grep -v ps | grep -v grep可以查看进程是否存在。
本脚本安装完成后,会将 shadowsocks-libev 加入开机自启动。
0 评论