0

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?

4 Answers 4

5

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 :)

2
  • selinux_register_security: Registering secondary module capability audit(1253173647.322:2): selinux=0 auid=4294967295 what is that mean?
    – Libyano
    Oct 13, 2009 at 8:37
  • 3
    selinux=0 means it is disabled. Even if your kernel has selinux support it is disabled.
    – drAlberT
    Oct 13, 2009 at 8:46
4

See Administrator Control of SELinux in the SELinux manual:

selinuxenabled;; echo $?

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

6
  • 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, 2009 at 8:34
  • No, it only means the utility doesn't exist. Use the selinuxenabled tool instead, like Zanchey suggests.
    – Roy
    Oct 13, 2009 at 8:40
  • It seems he has not selinux-utils installed, but his kernel supports selinux, being disabled.
    – drAlberT
    Oct 13, 2009 at 10:20
  • I believe RHEL has a customized set of tools. They are installed by default.
    – Roy
    Oct 13, 2009 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
    – drAlberT
    Oct 13, 2009 at 11:01
3

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

1

In Red Hat systems, you could edit /etc/selinux/config and set:

SELINUX=disabled

Reboot and you are golden.

1
  • do I really need to reboot to disable it?
    – cd1
    Jan 28, 2010 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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