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
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 :)
See Administrator Control of SELinux in the SELinux manual:
selinuxenabled;; echo $?
will display 0 if SELinux is enabled and -256 if it is disabled.
-
When i try /usr/bin/sestatus it says bash: /usr/bin/sestatus: No such file or directory , is that meaning selinux is not exists?– LibyanoOct 13, 2009 at 8:34
-
No, it only means the utility doesn't exist. Use the selinuxenabled tool instead, like Zanchey suggests.– RoyOct 13, 2009 at 8:40
-
It seems he has not selinux-utils installed, but his kernel supports selinux, being disabled.– drAlberTOct 13, 2009 at 10:20
-
I believe RHEL has a customized set of tools. They are installed by default.– RoyOct 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– drAlberTOct 13, 2009 at 11:01
The standard interactive tool on RHEL is getenforce. It outputs a message telling the user which mode SELinux is in: enforcing, permissive or disabled.
In Red Hat systems, you could edit /etc/selinux/config
and set:
SELINUX=disabled
Reboot and you are golden.