I'm not sure if I remember when I installed red hat 5 on my server. So how I can be sure whether selinux is disabled or not?

link|improve this question

40% accept rate
feedback

4 Answers

up vote 4 down vote accepted

Simply try

grep -i selinux /var/log/dmesg

Note:
The clean way to determine if selinux is enabled or not would be to use the selinuxenabled tool from libselinux-utils package. The issue is that your kernel could have selinux compiled and enforced, but (for various uncommon reasons) not have selinux-utils installed.
This is a quite uncommon situation, but it resambles to yours :)

link|improve this answer
selinux_register_security: Registering secondary module capability audit(1253173647.322:2): selinux=0 auid=4294967295 what is that mean? – Libyano Oct 13 '09 at 8:37
3  
selinux=0 means it is disabled. Even if your kernel has selinux support it is disabled. – AlberT Oct 13 '09 at 8:46
feedback

See Administrator Control of SELinux in the SELinux manual:

selinuxenabled;; echo $?

will display 0 if SELinux is enabled and -256 if it is disabled.

link|improve this answer
When i try /usr/bin/sestatus it says bash: /usr/bin/sestatus: No such file or directory , is that meaning selinux is not exists? – Libyano Oct 13 '09 at 8:34
No, it only means the utility doesn't exist. Use the selinuxenabled tool instead, like Zanchey suggests. – Roy Oct 13 '09 at 8:40
It seems he has not selinux-utils installed, but his kernel supports selinux, being disabled. – AlberT Oct 13 '09 at 10:20
I believe RHEL has a customized set of tools. They are installed by default. – Roy Oct 13 '09 at 10:46
What is default for you? On my systems I use --no-base in the ks @packages section, and my defaults on RHEL is to not have such tools – AlberT Oct 13 '09 at 11:01
show 1 more comment
feedback

The standard interactive tool on RHEL is getenforce. It outputs a message telling the user which mode SELinux is in: enforcing, permissive or disabled.

link|improve this answer
feedback

In redhat systems, you could edit:

/etc/selinux/config

and set:

SELINUX=disabled

Reboot and you are golden.

link|improve this answer
do I really need to reboot to disable it? – CD1 Jan 28 '10 at 17:57
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.