SELinux Troubleshooting: How to Temporarily Enable Permissive Mode

Temporarily Enable SELinux Permissive Mode on Linux Systems

Question

A Linux systems administrator installed a new web server, which failed while attempting to start.

The administrator suspects that SELinux is causing an issue and wants to temporarily put the system into permissive mode.

Which of the following would allow the administrator to accomplish this?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B.

The correct answer is B. setenforce 0.

Explanation: SELinux (Security-Enhanced Linux) is a Linux kernel security module that provides a mechanism for supporting access control security policies. SELinux provides a mandatory access control (MAC) system that enforces rules set by the system administrator. When SELinux is in enforcing mode, it denies access to resources that are not explicitly allowed.

If the administrator suspects that SELinux is causing the web server to fail, they can temporarily put the system into permissive mode. In permissive mode, SELinux will log denials but will not enforce them, allowing the administrator to troubleshoot the issue.

Option A is incorrect because it sets the SELinux mode to permissive, but it does not actually put the system into permissive mode. The changes made to the SELinux configuration file will only take effect after the system is rebooted or the SELinux policy is reloaded.

Option C is incorrect because sestatus is a command that displays the current SELinux status, but it does not allow the administrator to change the SELinux mode.

Option D is incorrect because it changes the SELinux context of the /var/ directory to httpd_sys_content_t, which is used to label files containing the content served by the Apache web server. This command does not change the SELinux mode to permissive.

Option B is the correct answer because setenforce is a command that allows the administrator to change the SELinux mode. The command "setenforce 0" puts the system into permissive mode, and "setenforce 1" puts the system back into enforcing mode. This command takes effect immediately and does not require a system reboot or SELinux policy reload.