1. 查看防火墙运行状态
systemctl status firewalld
或
systemctl status firewalld.service

2. 防火墙的 开启|关闭|重启
systemctl start firewalld

systemctl stop firewalld

systemctl restart firewalld

3. centos7 防火墙设置 开机启动和开机不启动
systemctl disable firewalld

systemctl enable firewalld

4. centos6 防火墙设置查看是否开机启动
chkconfig --list|grep network
5. 开启和关闭 Selinux
SELinux是一种基于 域-类型 模型(domain-type)的强制访问控制(MAC)安全系统,它由NSA编写并设计成内核模块包含到内核中,相应的某些安全相关的应用也被打了SELinux的补丁,最后还有一个相应的安全策略。任何程序对其资源享有完全的控制权。假设某个程序打算把含有潜在重要信息的文件扔到/tmp目录下,那么在DAC情况下没人能阻止他。SELinux提供了比传统的UNIX权限更好的访问控制。
查看Selinux是否开启
getenforce # Enforcing 是开启, Permissive
临时关闭SeLinux
setenforce 0
临时开启SeLinux
setenforce 1
永久关闭: 编辑配置文件
vi /etc/selinux/config
SELINUX 设置为 disabled

参数说明:
enforcing 强制开启
permissive 宽容模式,以waring方式代替 enforcing
disabeld 关闭SeLinux
修改完后需要重启系统
reboot
网友评论