ZeroKong
文章19
标签16
分类6
Centos8关闭SELinux

Centos8关闭SELinux

约191字 预计需要1分钟

Centos8关闭SELinux

Centos8关闭SELinux

查看状态

使用sestatus命令查看当前SELinux状态

1
2
3
4
5
6
7
8
9
10
11
[root@CentOS8-DEV ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Memory protection checking: actual (secure)
Max kernel policy version: 31

可以得到当前的状态是enabled的

在CentOS 8上永久禁用SELinux

编辑SELinux配置文件/etc/selinux/config

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@CentOS8-DEV ~]# 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 three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

SELINUX=enforcing修改为SELINUX=disabled
重启机器reboot
再次查看当前SELinux状态

1
2
?[root@CentOS8-DEV ~]# sestatus
SELinux status: disabled
本文作者:ZeroKong
本文链接:https://blog.zerokong.com/20200413-Centos8%E5%85%B3%E9%97%ADSELinux/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可
×