selinux:turn_off_selinux
This is an old revision of the document!
SELinux - Turn off SELinux
Type the following command:
echo 0 >/selinux/enforce
You can also use the setenforce command to effectively disable it, enter:
setenforce Permissive
OR
setenforce 0
The above commands will switch off SELinux enforcement temporarily until the machine is rebooted. If you would like to make it permanently, edit /etc/sysconfig/selinux, enter:
vi /etc/sysconfig/selinux
And set / update it as follows:
- /etc/sysconfig/selinux
SELINUX=disabled
Save and close the file. The above will only work in CentOS, Fedora and RedHat Enterprise Linux systems. For all other Linux distros edit your boot loader config file (LILO or GRUB boot loader config file such as /boot/grub/grub.conf). Find the kernel line, append enforcing=0 at the end:
title Red Hat Enterprise Linux Server (2.6.18-194.26.1.el5) root (hd0,0) kernel /vmlinuz-2.6.18-194.26.1.el5 ro root=LABEL=/ console=tty0 console=ttyS1,19200n8 enforcing=0 initrd /initrd-2.6.18-194.26.1.el5.img
Finally, reboot the system:
reboot
selinux/turn_off_selinux.1468234645.txt.gz · Last modified: 2020/07/15 09:30 (external edit)