2019年2月10日
Centos7安装shadowsocks-libev
yum install -y epel-release
yum update -y
yum install -y gcc gcc-c++ pcre-devel asciidoc xmlto openssl openssl-devel mbedtls-devel libsodium-devel c-ares-devel libev-devel wget tar make
wget https://github.com/shadowsocks/shadowsocks-libev/releases/download/v3.3.5/shadowsocks-libev-3.3.5.tar.gz
tar xvf shadowsocks-libev*
rm -rf shadowsocks-libev-*.tar.gz
cd shadowsocks-libev*
./configure -prefix=/usr/local/shadowsocks-libev && make && make install
所有用户永久添加环境变量:
编辑/etc/profile文件 vim /etc/profile <<—- 通过这种方式,在关闭xshell后,添加的环境变量不生效
文件末尾添加:export PATH=”/usr/local/shadowsocks-libev/bin/:$PATH”
source /etc/profile
vi /etc/shadowsocks.json
单shadowsocks-libev实例配置:
{
"server":"0.0.0.0",
"server_port":7788,
"local_port":1080,
"password":"password",
"timeout":300,
"method":"aes-256-cfb"
}
nohup ss-server -c /etc/shadowsocks.json &
多shadowsocks-libev实例配置: { "server":"0.0.0.0", "server_port":8388, "port_password":{ "端口":"密码", "端口":"密码", "端口":"密码", "端口":"密码" }, "local_port":1080, "timeout":300, "method":"aes-256-cfb" } nohup ss-manager -c /etc/shadowsocks.json &
可选步骤:新建一个低权限账号运行 shadowsocks-libev 程序,防止软件bug导致服务器被黑
useradd -MN -s /sbin/nologin ss nohup ss-server -a ss -u -c /etc/shadowsocks.json &