ShadowSS Docker安装

执行:

docker run -dt --name ss -p 80:80 -p 1080:1080/udp mritd/shadowsocks -s "-s :: -s 0.0.0.0 -p 80 -m aes-256-cfb -k superpika --fast-open" -k "-t 127.0.0.1:80 -l :1080 -mode fast2" -x

其中 80 端口为对外的端口,密码 superpika,加密方式 aes-256-cfb

常规装法

服务器端搭建(您可以忽视这个)

用户只需安装客户端, 不需要安装服务器端.

一登陆进终端, 我就开始:

pip install shadowsocks

好的, 我们再来:

vim /etc/sysctl.d/local.conf

增加

# max open files
fs.file-max = 51200
# max read buffer
net.core.rmem_max = 67108864
# max write buffer
net.core.wmem_max = 67108864
# default read buffer
net.core.rmem_default = 65536
# default write buffer
net.core.wmem_default = 65536
# max processor input queue
net.core.netdev_max_backlog = 4096
# max backlog
net.core.somaxconn = 4096

# resist SYN flood attacks
net.ipv4.tcp_syncookies = 1
# reuse timewait sockets when safe
net.ipv4.tcp_tw_reuse = 1
# turn off fast timewait sockets recycling
net.ipv4.tcp_tw_recycle = 0
# short FIN timeout
net.ipv4.tcp_fin_timeout = 30
# short keepalive time
net.ipv4.tcp_keepalive_time = 1200
# outbound port range
net.ipv4.ip_local_port_range = 10000 65000
# max SYN backlog
net.ipv4.tcp_max_syn_backlog = 4096
# max timewait sockets held by system simultaneously
net.ipv4.tcp_max_tw_buckets = 5000
# turn on TCP Fast Open on both client and server side
net.ipv4.tcp_fastopen = 3
# TCP receive buffer
net.ipv4.tcp_rmem = 4096 87380 67108864
# TCP write buffer
net.ipv4.tcp_wmem = 4096 65536 67108864
# turn on path MTU discovery
net.ipv4.tcp_mtu_probing = 1

# for high-latency network
net.ipv4.tcp_congestion_control = hybla

# for low-latency network, use cubic instead
# net.ipv4.tcp_congestion_control = cubic

生效:

sysctl --system

新建/root/c.json

{
    "server":"0.0.0.0",
    "server_port":8888,
    "local_address": "127.0.0.1",
    "local_port":8888,
    "password":"xxxx",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": true
}

前台试跑:

ssserver -c /root/c.json

后台跑和停止:

ssserver -c /root/c.json -d start
ssserver -c /root/c.json -d stop

我选择:

ssserver -c /root/c.json -d start

# 看看日志
tail -f -n 10 /var/log/shadowsocks.log

这样, 你就可以访问您的ip:8888, 密码:xxxx去合理上网了。记得打开阿里巴巴的安全组!

客户端搭建

请看Windows系统

请看Mac系统/苹果手机

安卓手机请到这里来下载apk, 随便下载一个安装!

Linux客户端请这样:

sudo pip install shadowsocks
sslocal -s 服务器域名或IP -p 8888 -k "密码" -l 1080 -t 600 -m rc4-md5 

下载后填入相关信息即可!