#安装依赖及ss5
yum install gcc openldap-devel pam-devel openssl-devel -y ;\
wget http://jaist.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz ;\
tar -xf ss5-3.8.9-8.tar.gz ;\
cd ss5-3.8.9/ ;\
make ;\
make install ;\
cd /etc/opt/ss5/ ;\
cp ss5.passwd ss5.passwd.org ;\
cp ss5.conf ss5.conf.org ;\
mkdir /var/run/ss5/
#配置密码访问
cat << "EOF" > /etc/opt/ss5/ss5.conf
auth 0.0.0.0/0 - u
permit u 0.0.0.0/0 - 0.0.0.0/0 - - - - -
EOF
#配置密码(根据需要,改成自己的用户名、密码)
echo 'user password_1234' > /etc/opt/ss5/ss5.passwd
#配置网络
echo 'SS5_OPTS=" -u root -b 0.0.0.0:1080"' > /etc/sysconfig/ss5
#关闭日志
sed -i.bak 's/-t/-m -t/g' /etc/init.d/ss5 && systemctl daemon-reload
#查看日志
tail -100f /var/log/ss5/ss5.log
# 开机自启动(3.8.9-8的一个bug,重启会删掉/var/run/ss5/,导致开机自启动时无法创建pid文件)
echo 'mkdir /var/run/ss5/' >> /etc/rc.d/rc.local ;\
chmod +x /etc/rc.d/rc.local ;\
/sbin/chkconfig ss5 on
#启动
service ss5 start && service ss5 status
#添加防火墙
firewall-cmd --add-port=1080/tcp --permanent ;\
firewall-cmd --reload
网友评论