Den nemmeste måde at kontrollere SELinux ( Security Enhanced Linux ) operationstilstand på er ved at bruge kommandoen getenforce
. Denne kommando uden nogen indstillinger eller argumenter vil blot udskrive en aktuel status SELinux-operationstilstand.
# getenforce Permissive
Den aktuelle status for SELinux-operationstilstand kan desuden indstilles permanent eller midlertidigt. Ovenstående getenforce
-kommando viser kun den aktuelle status, men for at se, om status blev sat midlertidigt af setenforce
eller af SELinux-konfigurationsfilen cat /etc/selinux/config
, skal sestatus
-kommandoen bruges.
# sestatus SELinux status: enabledSELinuxfs mount: /sys/fs/selinuxSELinux root directory: /etc/selinuxLoaded policy name: targetedCurrent mode: permissiveMode from config file: enforcingPolicy MLS status: enabledPolicy deny_unknown status: allowedMax kernel policy version: 29
I ovenstående output af sestatus-kommandoen kan vi se, at den aktuelle SELinux-operationstilstand mere er permissiv, mens enforcing-tilstand er indstillet af konfigurationsfilen, som træder i kraft efter genstart.