Linux – setenforce: SELinux is disabled

centosftplinuxselinux

I'm in a CentOS 5 machine, and try to install vsftpd. I want to configure ftp_home_dir using setsebool -P ftp_home_dir on but it says:

setsebool: SELinux is disabled.

I try to enable it using setenforce it still says:

setenforce: SELinux is disabled

then I tried:

semodule -n -B

and it says:

semodule: SELinux policy is not managed or store cannot be accessed.

my config file:

# 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 - SELinux is fully disabled.
SELINUX=permissive
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

Note: rebooted many times.

Best Answer

The kernel you are using was built without SELinux support. Using a stock kernel will not include the appropriate parts for your VPS. Rebuilding the kernel with SELinux support will cause the VPS parts to not work. You cannot use SELinux on your VPS.