Solved

how to enable Selinux

Posted on 2014-09-11
7
405 Views
Last Modified: 2014-09-11
I try to enable Selinux from this site,http://wiki.eri.ucsb.edu/sysadm/SELinux , but it didn't work, On linux shell, I tried this command as follows

root@vps# getenforce

Disabled

root@vps#setenforece 1

setenforce: SELinux is disabled

root@vps# getenforce

Disabled

change the file at /etc/sysconfig/selinux from changing SELINUX=enforcing to SELINUX=disabled

reboot, but it didn't work.

On the link instruction, why turn on Selinux need to SELINUX=disabled ?
And how I know selinux is enabled or not ?

Please advise
0
Comment
Question by:rwniceing
  • 4
  • 2
7 Comments
 
LVL 23

Assisted Solution

by:savone
savone earned 100 total points
ID: 40318167
Edit  /etc/selinux/config and make sure it is enforcing.

The file should look like this when done:
# 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,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted


Reboot the system to load selinux.
0
 
LVL 1

Author Comment

by:rwniceing
ID: 40318175
Yes  I did,

but when getenforce it still echo

Disabled

I talk to my hosting company said
We use OpenVZ virtualization (most popular VPS virtualization system), which doesn't support selinux for security reasons, i am sorry, but we have no option to enable it.

Is the main reason from the hosting company statement that is why
always get "Disabled" from getenforce ?
0
 
LVL 1

Author Comment

by:rwniceing
ID: 40318180
Whatever I try, I always get this

root@vps#setenforece 1

setenforce: SELinux is disabled
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 4

Assisted Solution

by:exploitedj
exploitedj earned 400 total points
ID: 40318215
Ok, the first thing to check is what does sestatus return for the "SELinux status: "

If that line returns disabled that means that you disabled it before a reboot. Think of this like the main breaker on your house. If it is off, the circuit breakers between enforcing and permissive won't mean much.

If that is the case you can set your  /etc/sysconfig/selinux to "SELINUX=enforcing"  then reboot.
The sestatus "SELinux status: " should now return "enabled". Now you can use set enforce to switch between enforcing and permissive.

Permissive is different than Disabled. It is SUPER IMPORTANT to understand how "Disabling" impacts policies relabeling. This is not uncommon and can lead to many headaches. Fedora documentation does a good job describing this. As do Dan Walsh's blogs. He is pretty much "the Man" with SeLinux.

Note - This may not fall into this thread but you typically want to avoid Disabling in SeLinux, even when troubleshooting, as you can undo a lot of policy label changes if you didn't set them properly. Go with Permissive as you gain your footing and if you need to figure out if SElinux is messing something up.
0
 
LVL 1

Author Comment

by:rwniceing
ID: 40318219
savone and exploitedj thanks for your reply,  exploitedj ,command result as follows

root@vps [~]# sestatus
SELinux status:                 disabled

Please read this post
http://www.experts-exchange.com/OS/Linux/Q_28516844.html

You agree hosting company has such ability ?
0
 
LVL 4

Accepted Solution

by:
exploitedj earned 400 total points
ID: 40318240
I just commented there and came here to double check that the virtualization was with OpenVZ. Guess so since you are the question asker in both?
0
 
LVL 1

Author Closing Comment

by:rwniceing
ID: 40318255
Thanks for all of your reply
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question