CentOS 7.6 Close Selinux

Check selinux status

[[emailprotected] ~]# 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
Max kernel policy version:
28

< h2>Temporary closure

[[email protected] ~]# setenforce  0

Close permanently

You can modify the configuration file /etc/selinux/config, set SELINUX to disabled. If you are not logging in with the root account, remember to add sudo in front.

[[email protected] ~]# vi /etc/selinux/< span style="color: #000000;">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
=enforcing
SELINUX
=disabled
# SELINUXTYPE
= can take one of three two values:
# targeted
- Targeted processes are protected,
# minimum
- Modification of targeted policy. Only selected processes are protected.
# mls
- Multi Level Security protection.
SELINUXTYPE
=targeted

[[email protected]
~]# sestatus
SELinux status: disabled

Check selinux status

[[emailprotected] ~]# 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
Max kernel policy version:
28

< p>

[[email protected] ~]# 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
Max kernel policy version:
28

[[email Protected] ~]# 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
Max kernel policy version:
28

[[email Protected] ~]# setenforce 0

[ [emailprotected] ~]# setenforce 0

[[emailprotected ] ~]# 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
=enforcing
SELINUX
=disabled
# SELINUXTYPE
= can take one of three two values:
# targeted
- Targeted processes are protected,
# minimum
- Modification of targeted policy. Only selected processes are protected.
# mls
- Multi Level Security protection.
SELINUXTYPE
=targeted

[[email protected]
~]# sestatus
SELinux status: disabled

Leave a Comment

Your email address will not be published.