爱学网
当前位置 : 爱学网 > 经验 > 科技经验 > CentOS7关闭防火墙和SELinux

CentOS7关闭防火墙和SELinux

更新时间:2026-05-05 17:48:39

本文主要讲述了如何在CentOS7上临时关闭防火墙、永久关闭防火墙、临时关闭SELinux和永久关闭SELinux的方法。

出自openstackblog。

防火墙(firewalld)

01

临时关闭防火墙systemctl stop firewalld

02

永久防火墙开机自启动systemctl disable firewalld

03

临时打开防火墙systemctl start firewalld

04

防火墙开机启动systemctl enablefirewalld

05

查看防火墙状态systemctl status firewalld

SELinux

01

临时关闭SELinuxsetenforce 0

02

临时打开SELinuxsetenforce 1

03

开机关闭SELinux编辑/etc/selinux/config文件,将SELINUX的值设置为disabled,如下图。下次开机SELinux就不会启动了。

04

查看SELinux状态执行getenforce命令

相关推荐