How to disable selinux in CentOS 5.2

Here’s how you would disable SELinux permanently.

1. vi the “/etc/selinux/config” file.

2. Change the following line;

SELINUX=enforcing to SELINUX=disabled

3.  Save the file and reboot.

4. To verify if SELinux is disabled, run “dmesg | grep selinux“. You should see selinux=0

selinux_register_security:  Registering secondary module capability
audit(1229470429.628:2): selinux=0 auid=4294967295 ses=4294967295

My /etc/selinux/config file.

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

  • Actually you can use the text GUI setup

    setup > Firewall Configuration > SeLinux > Disabled

    the same effect and still available with any text based centos.

  • thanks dude 🙂

  • Simon

    The console command to run the GUI that Amran mentions is “system-config-securitylevel-tui”.

    Be warned though that if you run this and have custom IPTables rules it will rewrite them… LOL. Found that out the hard way!

© 2008-2012 The Danesh Project
Powered by Wordpress and made by Guerrilla. Hosted at ServerFreak