ubuntu22.04配置shadowsocks
1. 更新软件库并下载shadowsocks
更新软件库
sh
sudo apt update
sudo apt upgrade
下载shadowsocks-libev
sh
sudo apt install shadowsocks-libev
2. 配置shadowsocks
新建配置文件
sh
sudo vim /etc/shadowsocks.json
配置文件信息
json
{
"server":"你服务器的外网ip地址",
"server_port":8388,
"password":"vpn链接密码",
"timeout":60,
"method":"aes-256-cfb" // 注意这里要使用小写否则加密算法不识别
}
3. 配置开机启动
创建开机启动service
sh
vim /etc/sytemd/system/shadowsocks-libev.service
文本配置内容
[Unit]
Description=Shadowsocks-libev Server
After=network.target
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'ulimit -n 51200'
ExecStart=ss-server -c /etc/shadowsocks.json
Restart=on-abort
[Install]
WantedBy=multi-user.target
启动服务
sh
systemctl start shadowsocks-libev
启动服务后先测试是否能正常连接,若无法正常链接,则有可能是上述service中配置文件不正确
ExecStart=ss-server -c /etc/shadowsocks.json
执行如下命令查看是否能正常启动服务并连接,若不正常排查shadowsocks-libev是否正确安装
ss-server -c /etc/shadowsocks.json
开机启动
sh
systemctl enable shadowsocks-libev