yum install -y gcc make libtool build-essential git
yum install -y curl curl-devel zlib-devel openssl-devel gnutls-devel \
mbedtls-devel libsodium-devel c-ares-devel libev-devel perl perl-devel \
pcre pcre-devel cpio expat-devel gettext-devel asciidoc xmlto
git clone --recursive https://github.com/shadowsocks/shadowsocks-libev.git
cd shadowsocks-libev
./autogen.sh
./configure --prefix=/usr && make
make install
{
"server": "0.0.0.0",
"server_port": ${SS_PORT},
"password": "${SS_PASSWORD}",
"method": "${SS_METHOD}",
"local_address": "127.0.0.1",
"local_port":1080,
"timeout":300,
"fast_open": false,
"workers": 1
}
SS_IP=`ip route get 1 | awk '{print $NF;exit}'`
SS_PORT=8050
SS_PASSWORD=$(random-string 32)
SS_METHOD=camellia-256-cfb #or camellia-256-cfb
[Unit]
Description=Shadowsocks Server Service
After=syslog.target network.target auditd.service
[Service]
Type=simple
User=nobody
TimeoutStartSec=0
ExecStart=/usr/bin/ss-server -c /etc/shadowsocks.json
[Install]
WantedBy=multi-user.target
systemctl enable shadowsocks
systemctl stop shadowsocks
systemctl start shadowsocks
systemctl status shadowsocks -l
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>shadowsocks</short>
<description>Enable Shadowsocks on ${SS_PORT}/tcp.</description>
<port protocol="tcp" port="${SS_PORT}"/>
</service>
firewall-cmd --permanent --zone=public --add-service=shadowsocks