CompTIA Linux+ (XK0-004) — Question 59
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?
Answer options
- A. echo SELINUX=PERMISSIVE >> /etc/sysconfig/selinux
- B. setenforce 0
- C. sestatus 0
- D. chcon httpd_sys_content_t /var/
Correct answer: C
Explanation
The correct command to temporarily set SELinux to permissive mode is 'setenforce 0', which allows the system to log actions that would have been denied without enforcing the policy. The option 'echo SELINUX=PERMISSIVE >> /etc/sysconfig/selinux' modifies the configuration file but requires a reboot to take effect. 'sestatus 0' is not a valid command, and 'chcon httpd_sys_content_t /var/' changes the SELinux context of a directory but does not affect the mode.