What command modifies SELinux mode temporarily?
The Correct Answer is: B. setenforce
The setenforce command is used to temporarily change the SELinux mode between Enforcing and Permissive without requiring a system reboot. This change is effective only until the next reboot, making it useful for testing or troubleshooting SELinux-related issues.
For example:
setenforce 0 sets SELinux to Permissive mode
setenforce 1 sets SELinux to Enforcing mode
Why the other options are incorrect:
A. selinuxconfig
There is no standard Linux command called selinuxconfig. While tools like system-config-selinux may exist on some systems, they are graphical utilities or scripts and not standard commands for temporary SELinux mode changes.
C. enforcectl
This is not a valid or recognized command in SELinux or Linux in general. It does not exist in standard distributions and does not affect SELinux settings.
D. changemode
There is no SELinux-specific command named changemode. Changing SELinux modes must be done through valid tools like setenforce (for temporary changes) or editing configuration files for permanent ones.
Discover a range of courses designed to provide you with the knowledge and skills needed to excel in your chosen field.
You don’t need one month to study and pass your test.
With Prepsaret, it takes you a few days to grasp all the concepts needed to pass your exams