Copied to clipboard

setenforce

The `setenforce` command is used to set the enforcement mode of SELinux. It can be used to set the SELinux enforcement mode to either enforcing mode or permissive mode.

Example

  • Set SELinux enforcement mode to enforcing mode:
setenforce 1
  • Set SELinux enforcement mode to permissive mode:
setenforce 0
  • Temporarily set SELinux enforcement mode to permissive mode until the next system reboot:
setenforce permissive
  • Permanently set SELinux enforcement mode to permissive mode:

Set the value of SELINUX to permissive in the /etc/selinux/config file and reboot the system.

Note: In production environments, SELinux enforcement mode should be set to enforcing mode to improve system security.