How to disable selinux
Without going into a lengthy discussion as to why this may be a bad idea – sometimes you just need to do it! Some of the earlier distributions to include selinux could literally tick you off with constant SE Linux security warnings, pollute the logs with them, render certain apps unusable. I myself remember several time selinux constant warnings driving me crazy and at some point one just says “Ok, how do I disable this selinux stuff?”
So…
For all ya bad, bad, undisciplined folk out there who just want to be able use their systems “like before” 🙂
How to disable SE Linux
First decide whether you want to disable SELinux temporarily (e.g. to debug a problem), or to switch it off permanently. With the first approach SE Linux will be up and running again after you reboot.
Next decide whether you want to make SE Linux allow all operations but still log warnings and keep track of file labels in the background (“Permissive” mode), OR completely turn it OFF (“Disabled”).
ATTENTION: Switching SELinux off if your computer is connected to a public network (directly connected to the Internet) is NOT recommended!
In theory, a better approach is to make changes to the app policy to permit the operations that are being blocked – but this requires knowledge of writing policies and may be a steep learning curve for some people. We will NOT discuss here this approach (changing the policies). We will look at the two methods of disabling SE Linux globally.
1. Method one – switch SELinux into “Permissive” mode
This will switch the SELinux kernel into a mode where all operations are allowed, but a warning message will be logged for any operation that would otherwise be denied. The mechanism that controls the permissions/policies of the files is still active and if at some future time you decide to re-enable SE Linux it can easily be done.
2. Method two – “Disable” SELinux completely
Help! I don’t have a /etc/selinux/config file!
Some Linux distros don’t have the /etc/selinux/config file. In this case you will need to edit the kernel boot line. Most systems nowadays use GRUB, so edit the /boot/grub/grub.conf file (if you’re using the GRUB boot loader. For LILO and other bootloaders apply the same logic but you will have to read their man pages to see where to find the kernel boot line to edit it).
Ok, so in the config file, on the kernel line, append either enforcing=0, to switch into permissive mode or selinux=0 to disable selinux.
Example:
title SELinux PERMISSIVE
root (hd0,0)
kernel /vmlinuz-huge-smp-2.6.29.6-smp ro root=/dev/sda6 enforcing=0
title SELinux DISABLED
root (hd0,0)
kernel /vmlinuz-huge-smp-2.6.29.6-smp ro root=/dev/sda6 selinux=0
-
Categories
- Android Development
- Bash
- C programming
- dpkg/apt-get
- drupal
- Emacs
- Git
- Java
- Linux administration
- Linux device drivers
- Linux Gaming
- Linux kernel
- Linux Networking
- Linux on Windows
- Linux printing
- Linux sound and ALSA
- Package Managers
- Programming
- RPM
- Shell and environment
- Tips and tricks
- Uncategorized
- VirtualBox
- Virtualization
- web development
- wine
- WMaker
- Wordpress Tips
- X Window System
- XFCE
-
Articles
- August 2020
- August 2019
- May 2019
- July 2017
- February 2017
- January 2017
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- April 2016
- March 2016
- December 2015
- November 2015
- September 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- October 2014
- February 2014
- January 2014
- November 2013
- October 2013
- June 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
-
Meta
Cloud
audio bash boot compile C programming cups drupal emacs etc Fedora git grep how to httpd init kernel libc linux linux partition localtime login make mount mp3 mysql networking oracle package managers password phpMyAdmin programming rpm shell sql vbox version control system virtual box vm web server wordpress www xargs xfce xwin yum