49.2.2.3. SELinux Utilities
The following are some of the commonly used SELinux utilities:
/usr/sbin/setenforce— Modifies in real-time the mode in which SELinux runs.For example:setenforce 1— SELinux runs in enforcing mode.setenforce 0— SELinux runs in permissive mode.To actually disable SELinux, you need to either specify the appropriatesetenforceparameter in/etc/sysconfig/selinuxor pass the parameterselinux=0to the kernel, either in/etc/grub.confor at boot time./usr/sbin/sestatus -v— Displays the detailed status of a system running SELinux. The following example shows an excerpt ofsestatus -voutput:Copy to Clipboard Copied! Toggle word wrap Toggle overflow /usr/bin/newrole— Runs a new shell in a new context, or role. Policy must allow the transition to the new role.Note
This command is only available if you have thepolicycoreutils-newrolepackage installed, which is required for the strict and MLS policies./sbin/restorecon— Sets the security context of one or more files by marking the extended attributes with the appropriate file or security context./sbin/fixfiles— Checks or corrects the security context database on the file system.
Refer to the man page associated with these utilities for more information.
Refer to the
setools or policycoreutils package contents for more information on all available binary utilities. To view the contents of a package, use the following command:
rpm -ql <package-name>