Enable permissive mode for SELinux troubleshooting purpose

last updated in Categories Linux, RedHat/Fedora Linux, Security, Troubleshooting

SELinux may create problem for network service if not configured properly. So you can turn off SELinux temporarily i.e. permissive mode for SELinux. In this mode SELinux will continue its work and it will log message to system log files. But it will not block any network service or protected service.


This is great for troubleshooting purpose. For example, squid proxy server or dovecot POP3/IMAP sever known to have problem with SELinux.

You can modify the mode SELinux is running in using setenforce command. Use value 1 to put SELinux in enforcing mode. Use value 0 to put SELinux in permissive mode. Use getenforce command to find out whether SELinux is enforcing, permissive, or disabled.

Get SELinux mode

# getenforce



Set SELinux mode to permissive mode

# setenforce 0
# getenforce



GUI tools for setting up SELinux mode

If you are using Fedora Core or Red Hat Enterprise Linux use system-config-securitylevel command to setup SELinux mode and other related properties. Type the following command at shell prompt:

$ system-config-securitylevel

Selinux can be disabled by passing kernel boot parameters. You need to edit grub.conf / menu.lst/ lilo.conf file.


Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

6 comment

  1. Well.what can i say but this website is amazing for open source lover like me ….this is very good website for enhancing the experiance in UNIX envirnoment.
    I love this website very much.and everyday I like to visit this site to enhance my skills.


  2. For almost four days, I have been struggling to know why my code to access SMTP server failed in Centos 6.2 yet it work in my Win XP development environment. Thanks alot for the post.

    Now I have disabled the SELinux and it is working; the next research is now on how to make this code work with SELinux enabled… a good start anywhy.


  3. the alot for the post. this website help me solve my problem. i love this website


    Have a question? Post it on our forum!