标签:服务器初始
sed -i ‘s#SELINUX=enforcing#SELINUX=disabled#g‘ /etc/selinux/config setenforce 0 iptables -F service iptables save chkconfig iptables off wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo yum clean all&&yum makecache yum -y install ntpdate ntpdate s1a.time.edu.cn sed -i ‘s/#Port 22/Port 8022/g;s/#PermitRootLogin yes/#PermitRootLogin no/g‘ /etc/ssh/sshd_config /etc/init.d/sshd reload
iptables
# Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j DROP -A INPUT -i lo -j ACCEPT -A OUTPUT -d 183.60.202.18 -j DROP -A OUTPUT -d 221.180.130.4 -j DROP -A OUTPUT -s 221.180.130.4 -j DROP -A OUTPUT -s 183.60.202.18 -j DROP -A INPUT -s 222.186.56.175 -m state --state NEW -m tcp -p tcp --dport 8022 -j DROP -A INPUT -m state --state NEW -m tcp -p tcp --dport 8022 -j ACCEPT -A OUTPUT -m state --state NEW -m tcp -p tcp --sport 8866 -j DROP -A OUTPUT -m state --state NEW -m tcp -p tcp --sport 6001 -j DROP -A OUTPUT -m state --state NEW -m tcp -p tcp --sport 10999 -j DROP -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 9181 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 873 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 874 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT
标签:服务器初始
原文地址:http://024mj.blog.51cto.com/10252785/1699462