CompTIA Linux+ (XK0-004) — Question 285
A Linux administrator experiences SELinux errors while troubleshooting a production web server. The administrator needs to disable SELinux to bring the production system back online quickly but still troubleshoot the SELinux issues. Which of the following commands would allow the administrator to achieve this goal?
Answer options
- A. setenforce 0
- B. getenforce disable
- C. getenforce permissive
- D. setenforce 1
Correct answer: A
Explanation
The command 'setenforce 0' is correct because it temporarily sets SELinux to permissive mode, allowing the server to function while still enabling troubleshooting. The other options are incorrect: 'getenforce disable' and 'getenforce permissive' are not valid commands for changing SELinux mode, and 'setenforce 1' would re-enable enforcing mode, which does not meet the requirement to disable SELinux.