1.iptables防火墙配置
最小化防火墙规则:配置防火墙, 拒绝所有端口,只放行SSH, HTTP这两个必要的端口。
[root@localhost ~]# iptables -F
[root@localhost ~]# iptables -p INPUT DROP
[root@localhost ~]# iptables -p INPUT DROP
[root@localhost ~]# iptables -p INPUT DROP
[root@localhost ~]# iptables -p INPUT DROP
[root@localhost ~]# iptables -A INPUT -p tcp --dport 443 -j ACCEPT
[root@localhost ~]# iptables -A INPUT -p tcp --dport 443 -j ACCEPT
2.开启SELinux(永久开启,需要设置 /etc/sel inux/config配置文件)
[root@localhost ~]# vim /etc/sel inux/config
#This file controls the state of SELinux on the system.
#SELINUX= can take one of these three values:
#enforcing一SELinux security policy is enforced.
#enforcing一SELinux security policy is enforced.