CENTOS7配多IP出口socks5和http代理
2021-01-27 11:16
标签:chmod tput pos source pen bind ret deny ice CENTOS7配多IP出口socks5和http代理 标签:chmod tput pos source pen bind ret deny ice 原文地址:https://www.cnblogs.com/ip99/p/13220934.html#!/bin/bash
yum -y install epel-release
yum -y update
yum -y remove firewalld
yum -y install iptables iptables-services
yum -y install gcc vim wget make
##配置selinux及主机名
hostnamectl set-hostname ss5_server_X
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
##安装http(s)代理,用户名密码认证HTTP代理
yum -y install tinyproxy squid
yum -y install pam-devel openssl-devel openldap-devel
##安装配置ss5代理
##wget https://nchc.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz
wget http://111.231.77.152:9999/ss5-3.8.9-8.tar.gz
tar vzxf ss5-3.8.9-8.tar.gz
cp -r ss5-3.8.9 ss5-3.8.9-modify
cd ss5-3.8.9
./configure
make
make install
sed -i "s/^#auth /auth /" /etc/opt/ss5/ss5.conf
sed -i "s/^#permit /permit /" /etc/opt/ss5/ss5.conf
##安装radius认证s5代理
cd ..
cd ss5-3.8.9-modify
sed -i "s/ss5.conf/ss5radius.conf/" include/config.h
sed -i "s/ss5.pid/ss5radius.pid/" include/config.h
sed -i "s/ss5.log/ss5radius.log/" include/config.h
sed -i "s/ss5.conf/ss5radius.conf/" include/config.h.in
sed -i "s/ss5.pid/ss5radius.pid/" include/config.h.in
sed -i "s/ss5.log/ss5radius.log/" include/config.h.in
make clean
./configure
make
cp src/ss5 /usr/sbin/ss5radius
cat >/etc/opt/ss5/ss5radius.conf/etc/sysconfig/network-scripts/ifcfg-ens33/etc/sysconfig/iptables
##配置免认证HTTP代理
sed -i "s/^Allow 127.0.0.1/#Allow 127.0.0.1 /" /etc/tinyproxy/tinyproxy.conf
sed -i "s/^#BindSame yes/BindSame yes /" /etc/tinyproxy/tinyproxy.conf
systemctl enable tinyproxy
service tinyproxy start
##配置用户名密码认证HTTP代理
systemctl enable squid
echo "server 192.168.168.254" >/etc/squid/squid_radius.conf
echo "secret 123456">>/etc/squid/squid_radius.conf
cat>/etc/squid/squid.conf/etc/rc.d/rc.local