MENU

Ubuntu 20.04 安装 shadowsocks-libev 服务端

February 3, 2020 • linux相关

 源码安装

1.1 准备环境:

sudo apt install --no-install-recommends build-essential autoconf libtool \
         libssl-dev gawk debhelper dh-systemd init-system-helpers pkg-config asciidoc \
         xmlto apg libpcre3-dev zlib1g-dev libev-dev libudns-dev libsodium-dev \
         libmbedtls-dev libc-ares-dev automake

1.2 获取shadowsocks-libev源码, 并安装

sudo apt install git
git clone https://github.com/shadowsocks/shadowsocks-libev.git
cd shadowsocks-libev
git submodule update --init
./autogen.sh && ./configure --disable-documentation && make
sudo make install

1.3 创建配置文件:

sudo mkdir /etc/shadowsocks-libev
sudo vi /etc/shadowsocks-libev/config.json

复制粘贴如下内容(注意修改密码“password”):

{
     "server":"0.0.0.0",
     "server_port":8388,
     "local_port":1080,
     "password":"password",
     "timeout":600,
     "method":"aes-256-cfb" ,
     "fast_open": false
}

1.4 创建Shadowsocks-libev.service配置文件

sudo vi /etc/systemd/system/shadowsocks-libev.service

内容:

[Unit]
Description=Shadowsocks-libev Server
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/ss-server -c /etc/shadowsocks-libev/config.json -u
Restart=on-abort

[Install]
WantedBy=multi-user.target

1.5 启动Shadowsocks:

sudo systemctl start shadowsocks-libev

1.6 开机启动

sudo systemctl enable shadowsocks-libev
Last Modified: December 1, 2021