While preparing a security-baseline report, you need a one-liner that prints only the name and current on/off value of every SELinux boolean on a RHEL-based server-no headings, descriptions, or other status information. Which command satisfies this requirement?
The getsebool utility is purpose-built for querying SELinux Boolean states. When it is invoked with the -a switch, it iterates through the policy and emits each Boolean followed by its on/off value, and nothing else, producing exactly the concise list the auditor requested.
sestatus -b can also show Boolean states, but it first prints general SELinux status information, so the output is not limited to just Boolean names and values. semanage boolean -l -C restricts its list to booleans that have been locally modified, omitting every Boolean that still matches the default policy, so it does not fulfil the "every Boolean" requirement. setsebool -P -a is syntactically invalid (setsebool expects individual Boolean assignments, and -P makes changes persistent); it does not produce a list at all.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is SELinux, and why are SELinux booleans important?
Open an interactive chat with Bash
How does `getsebool -a` differ from other SELinux tools like `sestatus`?
Open an interactive chat with Bash
What is the difference between default and locally modified SELinux booleans?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access