-
Notifications
You must be signed in to change notification settings - Fork 0
/
ss5.sh
65 lines (49 loc) · 1.74 KB
/
ss5.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
## ss5实现socke代理 2016-08-10
## http://www.aqzt.com
## email: [email protected]
## robert yu
## centos 7
yum -y install gcc gcc-c++ automake make pam-devel openldap-devel cyrus-sasl-devel openssl-devel
wget http://jaist.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz
tar zxvf ss5-3.8.9-8.tar.gz
cd ss5-3.8.9-8
./configure && make && make install
cat >/etc/opt/ss5/ss5.passwd<<EOF
test 123123
aaa 123123
bbb 123123
EOF
##无分组无限制配置
cat >/etc/opt/ss5/ss5.conf<<EOF
auth 0.0.0.0/0 - u
permit u 0.0.0.0/0 - 0.0.0.0/0 - - - - -
EOF
##创建分组
echo "test">/etc/opt/ss5/ulimit
echo "aaa" >>/etc/opt/ss5/ulimit
echo "bbb" >/etc/opt/ss5/limit
##有分组 ,有限制配置
cat >/etc/opt/ss5/ss5.conf<<EOF
auth 0.0.0.0/0 - u
permit u 0.0.0.0/0 - 0.0.0.0/0 - - ulimit - -
permit u 0.0.0.0/0 - 0.0.0.0/0 80 - limit - -
permit u 0.0.0.0/0 - 0.0.0.0/0 - - ulimit - -
permit u 0.0.0.0/0 - 0.0.0.0/0 443 - limit - -
EOF
echo "SS5_OPTS=\" -u root -b 0.0.0.0:10888\"" >>/etc/sysconfig/ss5
##使用默认端口
##echo "SS5_OPTS=\" -u root\"" >>/etc/sysconfig/ss5
##/etc/rc.d/init.d/ss5 文件修改自定义端口,默认为1080
##daemon /usr/sbin/ss5 -t $SS5_OPTS -b 0.0.0.0:10888
chmod 700 /etc/rc.d/init.d/ss5
chmod +x /etc/rc.d/init.d/ss5
##启动ss5
service ss5 start
##停止ss5
#service ss5 stop
##加入开机自动启动 centos6
#chkconfig --add ss5
#chkconfig --level 345 ss5 on
##查看日志启动是否成功
tail -f /var/log/ss5/ss5.log