3

I just checked to see if SELINUX was enabled on my server like this

[root@fedora ~]# getenforce
Disabled

However, when I look at the /etc/selinux/config file I see this

# 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 three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are pr$
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

How do I making it so SELINUX actually sets to enforcing? Preferably without rebooting the server.

When I run [root@fedora ~]# setenforce 1 I get this message

setenforce: SELinux is disabled

And SELINUX remains disabled.

  • setenforce [0|1] toggles between permissive and enforcing; it cannot enable SELinux on a running system. – user4556274 Aug 16 '16 at 22:02
  • Ah, ok. But with the above config file in place it should enable after I reboot, right? – user179084 Aug 16 '16 at 22:03
  • I would expect it to be enabled after a boot with the given /etc/selinux/config. If it is not, we need more information. (Was the file already in that state last time the system was booted? I think recent Fedora all have SELinux enabled by default.) Check docs.fedoraproject.org/en-US/Fedora/11/html/… – user4556274 Aug 16 '16 at 22:06
  • It was a clean install of Fedora on a Linode using the default settings. I assume the conf file was that way when it was installed as I haven't changed it since. Either way I'll reboot and see if it helps. – user179084 Aug 16 '16 at 22:07
  • 4
    I'm voting to close this question as off-topic because the user is on linode with a linode provided (custom) kernel that doesn't support SELinux. – Stephen Harris Aug 17 '16 at 0:45
1

After checking with the Linode people it seems the version of Fedora 24 installed by default on Linodes has a custom kernel that doesn't support SELinux and that's why it's not working. So the only solution would be to reimage the whole thing, which is a little drastic, so I'm just going to do without it.

| improve this answer | |
0

To enable SELinux without rebooting use setenforce 1. Note that if SELinux has been disabled for some time you will need to restorecon files without or with incorrect labels.

| improve this answer | |
  • Thanks but it didn't work :/. Added step to answer. – user179084 Aug 16 '16 at 22:01