- 安装GCC和编译所需包
yum install -y build-essential autoconf libtool libssl-dev gcc openssl openssl-devel make - 下载最新的源码
wget https://github.com/madeye/shadowsocks-libev/archive/master.zip -O shadowsocks-libev.zip - 解压缩
unzip shadowsocks-libev.zip - 配置、编译、安装,逐一执行以下命令:
cd shadowsocks-libev-master
./configure
make
make install - 另一种安装(rpm安装,无需编译),先下载yum repo,然后直接 yum install -y shadowsocks-libev
- 将ss-server加入启动项,在/etc/rc.local在文件最后新增一行,添加:
/usr/local/bin/ss-server -s ${serverIP} -p ${port} -k ${password} -m ${加密方式,例如:aes-256-cfb } & - 修改防火墙规则,允许连接:
-A INPUT -d ${serverIP}/32 -p tcp -m state –state NEW -m tcp –dport ${port} -j ACCEPT