How to Enable or Disable SELinux

General How Tos, which are NOT OS specified

Moderator: xeont

How to Enable or Disable SELinux

Postby markm » Thu Jun 27, 2013 3:32 pm

Hi all,

i just want to know how to Enable and Disable SELinux?

Thanks
Last edited by markm on Thu Jun 27, 2013 3:37 pm, edited 1 time in total.
markm
 
Posts: 2
Joined: Thu Jun 27, 2013 3:02 pm

Re: How to Enable or Disable SELinux

Postby xeont » Thu Jun 27, 2013 3:36 pm

you can check your SELinux Status first,

# getenforce

to Enable SELinux

# setenforce 1

to Disable SELinux

# setenforce 0
xeont
 
Posts: 13
Joined: Wed Jun 26, 2013 4:13 am

Re: How to Enable or Disable SELinux

Postby markm » Fri Jun 28, 2013 2:36 am

xeont wrote:you can check your SELinux Status first,

# getenforce

to Enable SELinux

# setenforce 1

to Disable SELinux

# setenforce 0


Thank you xeont
markm
 
Posts: 2
Joined: Thu Jun 27, 2013 3:02 pm

Re: How to Enable or Disable SELinux

Postby xeont » Sun Jun 30, 2013 10:50 am

markm,

When you run,

# getenforce

and result,

Disable

you may have to EDIT /etc/selinux/config file and change SELINUX=disable to SELINUX=permissive

Code: Select all
# 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=permissive
# SELINUXTYPE= can take one of these two values:
#       targeted - Targeted processes are protected,
#       mls - Multi Level Security protection.
SELINUXTYPE=targeted


A Restart will required once you done it to make it effect.

SELINUX=permissive mode is only enable SELinux to log your Allows/Denials in /var/log/audit/audit.log file

It will not Force SELinux Policies on your system. I guess its a good way to start. This will be helpful making Local Policies if you need any on your system.

Regards,
Xeont
xeont
 
Posts: 13
Joined: Wed Jun 26, 2013 4:13 am

Re: How to Enable or Disable SELinux

Postby rhatdan » Tue Jul 02, 2013 10:46 am

setenforce 0

Does not disable SELinux, it puts it into permissive mode.

Here is a very old blog that explains this.

http://danwalsh.livejournal.com/3144.html
rhatdan
 
Posts: 6
Joined: Tue Jul 02, 2013 10:10 am

Re: How to Enable or Disable SELinux

Postby dawud » Wed Jul 03, 2013 2:08 pm

While the _entry_ might be a little old, the _blog_ remains to be one (if not the most) authoritative source of wisdom with regards to anything related SELinux.
User avatar
dawud
 
Posts: 1
Joined: Tue Jul 02, 2013 9:03 pm

Re: How to Enable or Disable SELinux

Postby Dominykas » Wed Feb 11, 2015 7:19 pm

Hey, guys, plz help me... When I go to etc\ I can't find selinux... Or my wishes going crazy xD :D :?:
Dominykas
 
Posts: 1
Joined: Wed Feb 11, 2015 7:13 pm

Re: How to Enable or Disable SELinux

Postby Tony » Thu Feb 19, 2015 5:22 am

Hi Dominykas,

Which Linux Distribution are you using?

Try,

Code: Select all
cd /etc/selinux
Tony
 
Posts: 2
Joined: Mon Jul 22, 2013 6:45 pm


Return to How Tos

Who is online

Users browsing this forum: No registered users and 1 guest
cron