1)安装
Debian / Ubuntu:
apt-get install python-pip
pip install shadowsocks
CentOS:
yum install python-setuptools && easy_install pip
pip install shadowsocks
2)配置
创建vim /etc/shadowsocks.json
文件:
{
"server":"my_server_ip",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"mypassword",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}
配置字段说明:
Name | Explanation |
---|---|
server | ss服务器监听的地址。0.0.0.0和*号都是代指全部ip,因为使用的是vps公网ip不稳定所以监听所有ip |
server_port | ss服务器端口 |
local_address | 本地监听地址 |
local_port | 本地端口 |
password | 密码 |
timeout | 超时(秒) |
method | 加密方式:默认”aes-256-cfb”, 其他 Encryption |
fast_open | 使用 TCP_FASTOPEN, true / false |
workers | Unix/Linux系统workers数 |
配置demo
配置单个ss账号:
{
"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
}
配置多个ss账号
{
"server":"0.0.0.0",
"port_password":{
"8381":"pwd1", # 端口号 : 密码
"8382":"pwd2",
"8383":"pwd3",
"8384":"pwd4"
},
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}
3)关闭防火墙
systemctl stop firewalld.service #停止
systemctl disable firewalld.service #禁用
4)启动ss服务
启动:
ssserver -c /etc/shadowsocks.json
or
ssserver -p 443 -k password -m rc4-md5
后台运行:
ssserver -c /etc/shadowsocks.json -d start
or
sudo ssserver -p 443 -k password -m rc4-md5 --user nobody -d start
后台停止:
ssserver -c /etc/shadowsocks.json -d stop
or
sudo ssserver -d stop
检查日志:
sudo less /var/log/shadowsocks.log
设置开机启动
vi /etc/rc.local
键入
ssserver -c /etc/shadowsocks.json -d start
到/etc/rc.local
shadowsocks 的日志保存在
/var/log/shadowsocks.log
安装shadowsocks客户端
官方文档:https://github.com/shadowsocks/shadowsocks/wiki/Shadowsocks-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E
linux
https://github.com/shadowsocks/shadowsocks-qt5/wiki/Installation
https://github.com/shadowsocks/shadowsocks-qt5/releases
Mac OS X
https://github.com/shadowsocks/ShadowsocksX-NG/releases
Windows
https://github.com/shadowsocks/shadowsocks-windows/releases
iOS
https://itunes.apple.com/app/apple-store/id1070901416?pt=2305194&ct=shadowsocks.org&mt=8
https://github.com/shadowsocks/shadowsocks-iOS/releases
Android
https://play.google.com/store/apps/details?id=com.github.shadowsocks
参考
https://github.com/shadowsocks/shadowsocks/wiki/Configuration-via-Config-File
https://www.rxblog.xyz/0-1-shadowsocks-start/
https://blog.csdn.net/wf632856695/article/details/79313258
https://blog.csdn.net/junbujianwpl/article/details/78639247
https://blog.csdn.net/chengxuyuanyonghu/article/details/74358289