Wednesday, April 18, 2012

tell SELinux to calm down & get out of the way

DO NOT DO THIS on an internet facing computer, this is only for crash and burn Linux boxen that you are testing in your lab and changing rapidly.

This applies to RedHat, Fedora or CentOS.  When you are in a test lab or even just trying different configurations for your server SELinux can get in your way. It may block what you are trying to do without notice or it may pop up several notices telling you that it is doing so. Either way it can be painful to test or change service configurations with it in full blown enforcing mode. So to make it less intrusive you may do the following (as root or sudo of course):
  1. Edit /etc/sysconfig/selinux with your favourite text editor
  2. You should see 
  3. Change the line SELINUX=enforcing to read
    SELINUX=permissive
  4. Save the file
  5. Reboot
That's it.  It will now log the information but not block your changes.  Of course once you are ready to go live, put it back!

To see the current status
CLI:  sestatus

By the way if you want to toggle it off and on temporarily:
CLI:  setenforce Permissive
or
CLI:  setenforce Enforcing

No comments:

Post a Comment