CentOS 7 关闭Selinux

查询SeLinux状态 

方法一、​

​getenforce​

 

默认显示Enforcing,如果是关闭则显示Disabled

方法二、​

/usr/sbin/sestatus -v​

 

第一行默认显示SELinux status: enabled

 

临时关闭

​​setenforce 0

 

永久关闭

​​vi /etc/selinux/config​

 

将文件中的SELINUX=enforcing改为SELINUX=disabled

然后重启机器生效,reboot

 

 

临时关闭:

[root@localhost ~]# getenforce
Enforcing

[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive

 

永久关闭:

[root@localhost ~]# vim /etc/sysconfig/selinux

SELINUX=enforcing 改为 SELINUX=disabled

修改配置需要重启

[root@localhost ~]# reboot

 

 

posted @ 2020-11-23 10:48  可樂Star  阅读(132)  评论(0编辑  收藏  举报