Applies to:
Linux OS - Version: Enterprise Linux 4.0 to Oracle Linux 5.0 - Release: RHEL4 to OL5
Linux x86
Linux x86-64
Linux Kernel - Version: 4.0 to 5.0
Goal
How to fully disable SELinux (Security Enhanced Linux); or set it to
"permissive" mode, in which case the SELinux software is loaded, but no
enforcing is made of the rules, only logging is performed.
Please note that disabling SELinux or setting to
"permissive" mode may have some security considerations. It is possible
to keep SELinux enabled, and add manual exclusion rules.
Solution
To completely disable SELinux, use either of these methods:
1. Edit /etc/selinux/config
- Change the SELINUX value to "SELINUX=disabled".
- Reboot the server.
2. Append kernel boot options
- Edit the kernel boot line and append "selinux=0" to the kernel boot options. For example:
title Red Hat Enterprise Linux AS (2.6.9-42.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.ELsmp ro root=LABEL=/ rhgb quiet selinux=0
initrd /initrd-2.6.9-42.ELsmp.img
To set SELinux to Permissive mode, use either of these methods:
1. Edit /etc/selinux/config
- Change the SELINUX value to "SELINUX=permissive".
- Reboot the server.
2. Append kernel boot options
- Edit the kernel boot line and append "enforcing=0" to the kernel boot options (Assuming SELinux is not set to disabled as in section above). For example:
title Red Hat Enterprise Linux AS (2.6.9-42.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.ELsmp ro root=LABEL=/ rhgb quiet enforcing=0
initrd /initrd-2.6.9-42.ELsmp.img
To check the status of SELinux, issue:
# /usr/sbin/sestatus
See
Note 432988.1 for more details on checking SELinux status.
[@more@]
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/161195/viewspace-1055555/
,如需转载,请注明出处,否则将追究法律责任。