SS的确用的很少了,但最近搞了个IPLC,不用过墙。搭个SS可能最省事。一键脚本是这位大哥写的。
Contents
hide
一键脚本
Shell
xxxxxxxxxx
10
1
# just in case
2
apt install git
3
# 下载一键脚本
4
git clone https://github.com/suniceman/ss-fly
5
# -i 后面的是密码和端口号
6
ss-fly/ss-fly.sh -i Passw0rd 20600
7
8
# 可选,将默认加密方法修改 /windows-v2rayN只认aes-256-gcm
9
sed -i 's/aes-256-cfb/aes-256-gcm/g' /etc/shadowsocks.json
10
/etc/init.d/ss-fly restart
然后就好了,对,好了。

如果是OVZ架构的NAT虚拟机,如要安装BBR,可以用这个
我试成功的是这个 https://github.com/tcp-nanqinlang/wiki/wiki/lkl-rinetd
Shell
xxxxxxxxxx
2
1
# 或者直接试 - 一样的
2
wget https://github.com/tcp-nanqinlang/lkl-rinetd/releases/download/1.1.0/tcp_nanqinlang-rinetd-debianorubuntu.sh && bash tcp_nanqinlang-rinetd-debianorubuntu.sh
有可能需要修改timeout – 配置文件在这
Shell
xxxxxxxxxx
5
1
vi /etc/shadowsocks.json
2
# change timeout to 900 or more
3
# log file
4
tail -f /var/log/shadowsocks.log
5
# 背景命令 /usr/bin/python /usr/local/bin/ssserver -c /etc/shadowsocks.json -d start
管理命令
Shell
xxxxxxxxxx
8
1
# 启动:
2
/etc/init.d/ss-fly start
3
# 停止:
4
/etc/init.d/ss-fly stop
5
# 重启:
6
/etc/init.d/ss-fly restart
7
# 状态:
8
/etc/init.d/ss-fly status
用docker一键安装
Shell
xxxxxxxxxx
42
1
SS_FOLDER="/data/docker-shadowsocks-libev"
2
SS_PORT=10056
3
SS_PASSWORD="abcde"
4
5
mkdir -p ${SS_FOLDER} && cd ${SS_FOLDER}
6
cat > ${SS_FOLDER}/config.json <<EOF
7
{
8
"server":"0.0.0.0",
9
"server_port":${SS_PORT},
10
"password":"${SS_PASSWORD}",
11
"timeout":600,
12
"method":"aes-256-gcm",
13
"fast_open":false,
14
"nameserver":"8.8.8.8",
15
"mode":"tcp_and_udp"
16
}
17
EOF
18
19
# 如果你想同时开启 simple-obfs,那么配置文件范例如下:
20
cat > ${SS_FOLDER}/config.json <<EOF
21
{
22
"server":"0.0.0.0",
23
"server_port":${SS_PORT},
24
"password":"${SS_PASSWORD}",
25
"timeout":600,
26
"method":"aes-256-gcm",
27
"fast_open":false,
28
"nameserver":"8.8.8.8",
29
"mode":"tcp_and_udp"
30
"plugin":"obfs-server",
31
"plugin_opts":"obfs=http"
32
}
33
EOF
34
35
# 启动
36
docker run -d -p --restart=always \
37
${SS_PORT}:${SS_PORT} -p ${SS_PORT}:${SS_PORT}/udp \
38
--name shadowsocks-libev \
39
-v /etc/shadowsocks-libev:/etc/shadowsocks-libev \
40
appso/shadowsocks-libev
41
42
docker logs -f shadowsocks-libev
或者apt 安装
Shell
xxxxxxxxxx
24
1
sudo apt-get update
2
sudo apt-get install python3-pip
3
sudo pip3 install shadowsocks
4
SS_FOLDER="/data/ss-apt"
5
SS_PORT=10056
6
SS_PASSWORD="abcde"
7
sudo mkdir $SS_FOLDER
8
9
cat > ${SS_FOLDER}/config.json <<EOF
10
{
11
"server":"0.0.0.0",
12
"server_port":${SS_PORT},
13
"password":"${SS_PASSWORD}",
14
"local_address": "127.0.0.1",
15
"local_port":1080,
16
"timeout":600,
17
"method":"aes-256-cfb",
18
"fast_open":false,
19
"nameserver":"8.8.8.8",
20
"mode":"tcp_and_udp"
21
}
22
EOF
23
ssserver -c ${SS_FOLDER}/config.json -d start
24