开始使用Shadowsocks-2022

Dawn5ky Lv2

随着 GFW的一步步加高,Shadowsocks原先的几个AEAD加密方式已经不太够用了,或多或少都可以被识别。在这种情况下,Xray-core在2022年六月初支持了全面更新的SS,也就是Shadowsocks-2022。 这次更新不仅仅加入了三种新加密方式(2022-blake3-aes-128-gcm2022-blake3-aes-256-gcm2022-blake3-chacha20-poly1305),而且“重新设计了一个全新协议”,解决了重放攻击等安全问题。

1.安装Xray

官方提供了对绝大多数Linux系统适用的一键脚本 ,当然你也可以直接使用下面的指令安装:

1
# bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install

官方脚本符合FHS规范 ,可执行文件在/usr/local/bin/xray,配置文件在/usr/local/etc/xray目录内。

2.使用Shadowsocks-2022

打开位于/usr/local/etc/xray目录下的config文件,并进行如下编辑:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"inbounds": [
{
"port": 1234,
"protocol": "shadowsocks",
"settings": {
"method": "2022-blake3-aes-128-gcm",
"password": "{{ psk }}",
"network": "tcp,udp"
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}

如果想实现多用户,则将部分配置用如下文本覆盖:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
"inbounds": [
{
"port": 1234,
"protocol": "shadowsocks",
"settings": {
"method": "2022-blake3-aes-128-gcm",
"password": "{{ server psk }}",
"clients": [
{
"password": "{{ user psk }}",
"email": "my user"
}
],
"network": "tcp,udp"
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}

(记得改密码,至于怎么改看下一步)

3.修改Shadowsocks-2022密钥(密码)

以前的Shadowsocks对密码并无特殊要求,但Shadowsocks-2022为了保证安全性,对其使用的PSK密钥提出了特殊要求。 你可以使用

1
openssl rand -base64 <长度>

以生成与 shadowsocks-rust 兼容的密钥,长度取决于所使用的加密方法。 具体密码长度要求如下:

  • 2022-blake3-aes-128-gcm : 16位
  • 2022-blake3-aes-256-gcm : 32位
  • 2022-blake3-chacha20-poly1305 : 32位

4.配置Xray客户端

官方给出的Shadowsocks-2022客户端配置如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
"inbounds": [
{
"port": 10801,
"protocol": "socks",
"settings": {
"udp": true
}
},
{
"port": 10802,
"protocol": "http"
}
],
"outbounds": [
{
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "{{ host }}",
"port": 1234,
"method": "2022-blake3-aes-128-gcm",
"password": "{{ psk }}"
}
]
}
}
]
}

如果想使用UDP over TCP,则使用如下的官方配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
"inbounds": [
{
"port": 10801,
"protocol": "socks",
"settings": {
"udp": true
}
},
{
"port": 10802,
"protocol": "http"
}
],
"outbounds": [
{
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "{{ host }}",
"port": 1234,
"method": "2022-blake3-aes-128-gcm",
"password": "{{ psk }}",
"uot": true
}
]
}
}
]
}

5.使用SagerNet连接Shadowsocks-2022

SagerNet在五月份就已经支持了Shadowsocks-2022。 下载:https://github.com/SagerNet/SagerNet/releases

  • 标题: 开始使用Shadowsocks-2022
  • 作者: Dawn5ky
  • 创建于 : 2022-06-12 02:49:46
  • 更新于 : 2023-10-16 18:05:44
  • 链接: https://dawn.best/127/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
 评论