CentOS查看 SELinux状态及关闭SELinux

原创
2018/01/19 19:40
阅读数 105

查看SELinux状态:

1、如果SELinux status参数为enabled或者getenforce显示Enforcing即为开启状态

[root@212 ~]# sestatus -v 
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted
[root@212 ~]# getenforce
Enforcing

 

关闭SELinux:

1、临时关闭(不用重启机器)

[root@212 ~]# setenforce 0

2、修改配置文件需要重启机器:

[root@212 ~]#  vi /etc/selinux/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.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

将SELINUX=enforcing改为SELINUX=disabled

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
1 收藏
0
分享
返回顶部
顶部