tonglin0325的个人主页

Ubuntu安装shadow$ocks-libev

参考 ubuntu16.04 配置shadowsocks及使用教程,支持chacha20-ietf-poly1305加密方式

安装shadow$ocks-libev#

1
2
3
4
5
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev -y
sudo apt-get update
sudo apt install shadowsocks-libev

**#

 配置文件**

1
2
sudo vi /etc/shadowsocks-libev.json

内容

1
2
3
4
5
6
7
8
9
10
11
12
{
"server":"XXXX服务器地址",
"server_port":XXXX端口,
"local_address":"127.0.0.1",
"local_port":1080,
"password":"XXXX密码",
"timeout":60,
"method":"chacha20-ietf-poly1305",
"fast_open":false,
"workers":1
}

 运行shadow$ocks#

1
2
ss-local -c /etc/shadowsocks-libev.json &

 

Centos下安装

参考

1
2
3
https://gist.github.com/aa65535/ea090063496b0d3a1748
https://roxhaiy.wordpress.com/2017/08/04/430/

步骤

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
cd /tmp
# 编译环境准备&安装依赖包
yum install -y gcc make libtool build-essential git
yum install -y yum install gettext gcc autoconf libtool automake make asciidoc xmlto c-ares-devel libev-devel
# 克隆源码
git clone --recursive https://github.com/shadowsocks/shadowsocks-libev.git
# 开始编译
cd shadowsocks-libev
./autogen.sh
./configure --prefix=/usr && make
make install
# 准备必须的文件
mkdir -p /etc/shadowsocks-libev
cp ./rpm/SOURCES/etc/init.d/shadowsocks-libev /etc/init.d/shadowsocks-libev
cp ./debian/config.json /etc/shadowsocks-libev/config.json
chmod +x /etc/init.d/shadowsocks-libev
# 编辑配置文件
vim /etc/shadowsocks-libev/config.json
# 添加开机自启动服务
chkconfig --add shadowsocks-libev
chkconfig shadowsocks-libev on
# 启动服务
service shadowsocks-libev start

期间遇到

configure: error: mbed TLS libraries not found.

1
2
yum install -y mbedtls-devel

configure: error: The Sodium crypto library libraries not found.

1
2
3
4
5
6
7
8
cd /tmp
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.13.tar.gz
tar -zxvf libsodium-1.0.13.tar.gz
cd libsodium-1.0.13
./configure
make && make check
sudo make install

配置

1
2
3
4
5
6
7
8
9
{
"server":"0.0.0.0",
"server_port":xxxx,
"local_port":xxxx,
"password":"xxxx",
"timeout":60,
"method":"chacha20-ietf-poly1305"
}