Which commands reconfigure SELinux to enforcing mode and verify the current mode?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which commands reconfigure SELinux to enforcing mode and verify the current mode?

Explanation:
Switching SELinux to Enforcing at runtime is done with setenforce, and you can immediately confirm the active mode with getenforce. Using setenforce 1 puts SELinux into Enforcing right away, and then getenforce reports the current mode, typically showing Enforcing. This pair directly achieves the goal of reconfiguring to enforcing and verifying it in one go. If you used 0 with setenforce, you’d move to Permissive instead, which wouldn’t satisfy the requirement. The other command listed, sestatus, shows whether SELinux is enforcing or permissive but does not change the mode, so it won’t reconfigure.

Switching SELinux to Enforcing at runtime is done with setenforce, and you can immediately confirm the active mode with getenforce. Using setenforce 1 puts SELinux into Enforcing right away, and then getenforce reports the current mode, typically showing Enforcing. This pair directly achieves the goal of reconfiguring to enforcing and verifying it in one go. If you used 0 with setenforce, you’d move to Permissive instead, which wouldn’t satisfy the requirement. The other command listed, sestatus, shows whether SELinux is enforcing or permissive but does not change the mode, so it won’t reconfigure.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy