查看状态
使用sestatus
命令查看当前SELinux状态
[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
[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状态
?[root@CentOS8-DEV ~]# sestatus
SELinux status: disabled
原创文章,作者:zerokong,如若转载,请注明出处:
https://blog.zerokong.com/%E5%AD%A6%E4%B9%A0/12.html