Temporarily disable SELinux

If you found something doesn’t work on your Linux box, one possible reasons would be the SELinux.

1. Check if the SELinux is enabled.

[ykyuen@dev.eureka ~]$ getenforce
Enforcing

 

2. If it returns Enforcing, that means SELinux is enabled.
 

3. Let’s switch off the SELinux temporarily.

[ykyuen@dev.eureka ~]$ setenforce 0
[ykyuen@dev.eureka ~]$ getenforce
Permissive

 

4. It returns Permissive which means the SELinux is disabled.
 

5. You can now repeat your setup and if it works, this implies that the SELinux is blocking your setup.
 

6. You can enable the SELinux by

[ykyuen@dev.eureka ~]$ setenforce 1
[ykyuen@dev.eureka ~]$ getenforce
Enforcing

 

7. The changes above would be reset to default after reboot. If you want to permanently change the default setting, edit the /etc/sysconfig/selinux.

# 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 - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

 

Done =)

Reference: How to Disable selinux in Red Hat or CentOS

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s