安装shadowsocks

1
2
3
4
5
6
7
8
# 安装依赖
> yum install epel-release python-pip libsodium

# 也可将 zip 包先下载到本地再安装
> pip install https://github.com/shadowsocks/shadowsocks/archive/master.zip -U

> sslocal --version
Shadowsocks 3.0.0

创建shadowsocks配置文件

1
2
> mkdir -p /etc/shadowsocks
> vim /etc/shadowsocks/config.json

添加以下内容

1
2
3
4
5
6
7
8
9
10
11
{
"server": "x.x.x.x", # Server IP
"server_port": 14131, # Server Port
"local_address": "127.0.0.1", # Local IP
"local_port": 1080, # Local Port
"password": "password", # Your Password
"timeout": 600, # Connection timeout
"method": "aes-256-cfb", # Encryption method
"fast_open": false, # Use TCP_FASTOPEN, requires Linux 3.7+
"workers": 1 # Number of worker threads
}

配置启动服务

1
2
3
4
5
6
7
8
9
10
> vim /etc/systemd/system/shadowsocks.service
[Unit]
Description=Shadowsocks

[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/sslocal -c /etc/shadowsocks/config.json

[Install]
WantedBy=multi-user.target

启动shadowsocket

1
2
3
systemctl start shadowsocks.service
systemctl status shadowsocks.service
systemctl enable shadowsocks.service

测试链接效果

1
curl --sockes5 127.0.0.1:1080 ifconfig.me

参考文章

  • 参考了一些大佬的文章不一一列出的感谢

最后更新: 2023年08月27日 03:06

原始链接: https://blog.icanwen.com/2022/12/19/linux-shadowocks-client/