Disabling SELinux in Oracle Linux 6
Is SELinux running?
You can test to see if SELinux is currently enabled with the following command
which will return an exit status 0 if SELinux is enabled and 1 if it is disabled. In true Linux style a better example would be:
# selinuxenabled && echo enabled || echo disabled enabled
Temporary turn off (disable) SELinux
The easiest method to disable SELinux temporarily until you either re-enable it or perform a system reboot is to execute the following command as root on the system:
# echo 0 > /selinux/enforce
Temporary turn on (enable) SELinux
Likewise, to enable SELinux (if disabled at boot) you simply execute:
# echo 1 > /selinux/enforce
Permanently disabling (turrning off) SElinux
To completely disable SELinux at system startup, edit the configuration file
/etc/selinux/config and change the
SELINUX option to disabled, like so:
Note: The above changes will not take effect until the system is rebooted. You will need to reboot your system or temporarily set SELinux to non-enforcing mode to create the desired effect like the example above.