(1)设置开机启用防火墙:systemctl enable firewalld.service
(2)设置开机禁用防火墙:systemctl disable firewalld.service
(3)启动防火墙:systemctl start firewalld
(4)关闭防火墙:systemctl stop firewalld
(5)检查防火墙状态:systemctl status firewalld
systemctl start iptables #启动
systemctl status iptables #查看运行状态
systemctl restart iptables.service #重启
systemctl stop iptables.service #停止
systemctl enable iptables.service #设置开机启动
systemctl disable iptables.service #禁止开机启动
关闭selinux
查看:getenforce/sestatus
临时:
#
setenforce 0
永久关闭:vi /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
设置后需要重启才能生效
|
|
enforcing:强制模式,代表 SELinux 运作中,且已经正确的开始限制 domain/type 了; permissive:宽容模式:代表 SELinux 运作中,不过仅会有警告讯息并不会实际限制 domain/type 的存取。这种模式可以运来作为 SELinux 的 debug 之用; disabled:关闭,SELinux 并没有实际运作。 |
「三年博客,如果觉得我的文章对您有用,请帮助本站成长」
共有 0 - linux 防火墙和selinux