Study guide
21.2 Use Boolean Settings to Modify SELinux Settings
Red Hat Certified System Administrator RHCSA
Track your progress as you read
Finished sections get a check mark.
1 Introduction & Exam Overview
1.1 Current Exam Facts 1.2 Lab Setup & Performance-Based Study Strategy
2 Essential Tools: Shell, Redirection & Text Analysis
2.1 Shell Prompt and Command Syntax 2.2 Input-Output Redirection and Pipes 2.3 grep and Regular Expressions for Text Analysis
3 Essential Tools: Remote Access, Users & Text Editing
3.1 Access Remote Systems Using SSH 3.2 Log In and Switch Users in Multiuser Targets 3.3 Create and Edit Text Files
4 Essential Tools: Files, Links & Archives
4.1 Create, Delete, Copy, and Move Files and Directories 4.2 Hard and Soft Links 4.3 Archive and Compress with tar, gzip, and bzip2
5 Essential Tools: Permissions & System Documentation
5.1 List, Set, and Change Standard ugo/rwx Permissions 5.2 System Documentation: man, info, and /usr/share/doc
6 Manage Software: RPM and Flatpak
6.1 Configure Access to RPM Repositories 6.2 Install and Remove RPM Software Packages 6.3 Configure Access to Flatpak Repositories 6.4 Install and Remove Flatpak Software Packages
7 Create Simple Shell Scripts
7.1 Conditional Execution: if, test, and [] 7.2 Looping Constructs for Files and Input 7.3 Process Script Inputs ($1, $2, and Beyond) 7.4 Process Shell Command Output in Scripts
8 Operate Running Systems: Boot and Recovery
8.1 Boot, Reboot, and Shut Down a System Normally 8.2 Boot Systems into Different Targets Manually 8.3 Interrupt the Boot Process to Gain Access
9 Operate Running Systems: Processes and Tuning
9.1 Identify and Kill CPU/Memory Intensive Processes 9.2 Adjust Process Scheduling 9.3 Manage Tuning Profiles
10 Operate Running Systems: Logs, Services & File Transfer
10.1 Locate and Interpret System Log Files and Journals 10.2 Preserve System Journals 10.3 Start, Stop, and Check Status of Network Services 10.4 Securely Transfer Files Between Systems
11 Configure Local Storage: Partitions and LVM
11.1 List, Create, and Delete Partitions on GPT Disks 11.2 Create and Remove Physical Volumes 11.3 Assign Physical Volumes to Volume Groups 11.4 Create and Delete Logical Volumes
12 Configure Local Storage: Mounting and Expansion
12.1 Mount File Systems at Boot by UUID or Label 12.2 Add Partitions, Logical Volumes, and Swap Non-Destructively
13 Create and Configure File Systems: Local FS and Permissions
13.1 Create, Mount, and Use VFAT, ext4, and XFS File Systems 13.2 Extend Existing Logical Volumes 13.3 Diagnose and Correct File Permission Problems
14 Create and Configure File Systems: NFS and autofs
14.1 Mount and Unmount Network File Systems Using NFS 14.2 Configure autofs
15 Deploy and Maintain: Scheduling, Services & Targets
15.1 Schedule Tasks with at, cron, and systemd Timers 15.2 Start, Stop, and Enable Services at Boot 15.3 Configure Systems to Boot into a Specific Target
16 Deploy and Maintain: Time, Software Updates & Bootloader
16.1 Configure Time Service Clients 16.2 Install and Update Software from CDN, Remote Repos, and Local Files 16.3 Modify the System Bootloader
17 Manage Basic Networking
17.1 Configure IPv4 and IPv6 Addresses 17.2 Configure Hostname Resolution 17.3 Configure Network Services to Start Automatically at Boot 17.4 Restrict Network Access Using firewalld and firewall-cmd
18 Manage Users and Groups
18.1 Create, Delete, and Modify Local User Accounts 18.2 Change Passwords and Adjust Password Aging 18.3 Create, Delete, and Modify Local Groups and Memberships 18.4 Configure Privileged Access
19 Manage Security: Firewall, umask & SSH Keys
19.1 Configure Firewall Settings with firewall-cmd and firewalld 19.2 Manage Default File Permissions 19.3 Configure Key-Based Authentication for SSH
20 Manage Security: SELinux Modes and Contexts
20.1 Set Enforcing and Permissive Modes for SELinux 20.2 List and Identify SELinux File and Process Contexts 20.3 Restore Default File Contexts
21 Manage Security: SELinux Ports and Booleans
21.1 Manage SELinux Port Labels 21.2 Use Boolean Settings to Modify SELinux Settings
21.2 Use Boolean Settings to Modify SELinux Settings
Key Takeaways Explain This Topic AI
SELinux booleans are on/off policy toggles that enable optional behaviors without writing custom policy modules.
List and query with getsebool -a and getsebool NAME; filter with grep to find service-related booleans.
Change runtime with setsebool NAME on|off; make persistent with setsebool -P NAME on|off (or semanage boolean -m).
Common EX200-style booleans include httpd_can_network_connect, httpd_enable_homedirs, httpd_use_nfs, nfs_export_all_rw, and related service toggles—discover exact names with getsebool -a | grep.
Confirm denials with ausearch/sealert; prefer the boolean sealert suggests over disabling SELinux or leaving Permissive.
Last updated: August 2026
21.2 Use Boolean Settings to Modify SELinux Settings
Quick Answer: Query with getsebool -a / getsebool NAME . Enable or disable with setsebool NAME on|off . Persist across reboot with setsebool -P NAME on|off . Find candidates via getsebool -a | grep http (or the service name). Use ausearch / sealert when unsure which boolean applies. Leave the system Enforcing .
Why booleans are an EX200 skill
Under Manage security , Red Hat expects you to use Boolean settings to modify SELinux settings . Lab language looks like:
- “Allow the web server to make outbound network connections (for example to a database or API).”
- “Enable SELinux so Apache can serve users’ public_html content.”
- “Allow NFS export behavior required by the lab without disabling SELinux.”
- “Make the boolean change persistent across reboot.”
Booleans are named switches shipped with the distribution policy. Turning one on expands what a confined domain may do; turning it off tightens behavior. You do not hand-write .te policy modules on RHCSA—you flip the boolean the policy author already provided.
Contrast with Section 21.1 :
- Problem class Typical tool
- Wrong port type for bind semanage port
- Wrong file type semanage fcontext + restorecon
- Optional feature denied by default policy setsebool
Many real failures need both a context fix and a boolean—read denials carefully.
- getsebool: list and query getsebool -a # all booleans and current values
- getsebool httpd_can_network_connect
- getsebool -a | grep httpd
- getsebool -a | grep nfs
- getsebool -a | grep ftp
- Output shape: httpd_can_network_connect --> off
- httpd_enable_homedirs --> off
- nfs_export_all_rw --> on
- Command Use
- getsebool -a Full inventory (long; filter with grep )
- getsebool NAME One boolean’s current effective value
- getsebool -a | grep pattern Exam-speed discovery
Do not memorize hundreds of names. Memorize the workflow : reproduce under Enforcing → read denial / sealert → grep booleans → setsebool -P → retest. # How many booleans exist? (curiosity; not needed on exam)
- getsebool -a | wc -l
- setsebool: change values # Runtime only (until reboot) — good for testing
- sudo setsebool httpd_can_network_connect on
- # Persistent (survives reboot) — what EX200 almost always wants
- sudo setsebool -P httpd_can_network_connect on
- # Turn off persistently
- sudo setsebool -P httpd_enable_homedirs off
- Form Persistence
- setsebool NAME on|off Runtime only
- setsebool -P NAME on|off Persistent local policy customization
- setsebool -P name1=on name2=off Multiple in one shot (supported form) # Multiple persistent changes
- sudo setsebool -P httpd_can_network_connect=on httpd_can_network_relay=on
- getsebool httpd_can_network_connect httpd_can_network_relay
Exam trap: Forgetting -P . The boolean looks correct now , fails after reboot , and EX200 grades persistent configuration. Always prefer setsebool -P unless you are deliberately testing. getsebool httpd_can_network_connect
- sudo setsebool -P httpd_can_network_connect on
- getsebool httpd_can_network_connect
- semanage boolean (alternate interface) sudo semanage boolean -l
- sudo semanage boolean -l | grep httpd_can_network
- sudo semanage boolean -m --on httpd_can_network_connect
- sudo semanage boolean -m --off httpd_can_network_connect
semanage boolean -l shows default vs current in some output formats—handy when verifying local overrides. setsebool -P remains the most common training path for RHCSA speed; either persistent method is fine if the end state is correct. sudo semanage boolean -l -C # customized booleans when supported
High-frequency booleans (examples to know by pattern)
Exact availability can depend on installed policy modules; always confirm with getsebool on the exam host. These names appear constantly in RHEL web/NFS/FTP labs:
HTTP / Apache family
- Boolean Typical meaning when on
- httpd_can_network_connect httpd may initiate outbound TCP (DB, APIs, backends)
- httpd_can_network_connect_db More specific DB connect allowance (when present)
- httpd_can_network_relay Act as relay / forward connections (proxy-style use)
- httpd_enable_homedirs Serve content from user home public_html-style paths
- httpd_use_nfs httpd may use NFS-mounted content
- httpd_use_cifs httpd may use CIFS/SMB-mounted content
- httpd_unified Unified handling of httpd content types (policy-dependent)
- httpd_enable_cgi CGI execution related allowance
- httpd_read_user_content Read user content outside strict defaults getsebool -a | grep httpd
- sudo setsebool -P httpd_can_network_connect on
- sudo setsebool -P httpd_enable_homedirs on
- sudo systemctl restart httpd # when testing behavior
Classic scenario: PHP/app on httpd must reach MariaDB on another host . DocumentRoot context may already be correct; the missing piece is often httpd_can_network_connect (or the DB-specific boolean if the denial names it).
NFS / file sharing family
- Boolean Typical meaning when on
- nfs_export_all_ro Export read-only broadly as policy allows
- nfs_export_all_rw Export read-write broadly as policy allows
- httpd_use_nfs Web content on NFS
- use_nfs_home_dirs Home directories on NFS (name as shown on host) getsebool -a | grep -i nfs
- sudo setsebool -P nfs_export_all_rw on
- FTP / SSH / misc patterns getsebool -a | grep ftp
- getsebool -a | grep ssh
# Examples often seen in training materials:
# ftpd_full_access, ssh_chroot_rw_homedirs, etc.—verify names on the system
Rule: The boolean name is usually service_capability in snake_case. Grep the service prefix first.
When to use a boolean vs a port label vs a file context Service won't BIND a non-default port → semanage port (21.1)
- Service can't READ/WRITE a path → fcontext + restorecon (20.x)
- Service can't perform OPTIONAL behavior → setsebool -P (this section)
- e.g. connect out, use NFS, serve homedirs
If you enable random booleans without evidence, you widen policy more than needed. Prefer the narrow fix sealert or the denial suggests.
- Troubleshooting with ausearch and sealert getenforce
- sudo ausearch -m avc -ts recent
- sudo ausearch -m avc -ts recent | less
- # setroubleshoot / sealert path (when installed)
- sudo sealert -a /var/log/audit/audit.log
sealert often prints a suggested boolean and a ready-to-run setsebool -P ... line. That is gold under time pressure— verify the suggestion matches the task, then apply it. # Workflow
- # 1) Trigger the failing action (curl page, mount, export, etc.)
- # 2) Read denials
- sudo ausearch -m avc -ts recent
- # 3) If sealert available, follow its boolean advice
- # 4) Apply persistently
- sudo setsebool -P suggested_boolean on
- # 5) Retest under Enforcing
- getenforce
- getsebool suggested_boolean
- Also check service logs : sudo journalctl -u httpd -e --no-pager
- sudo tail -n 50 /var/log/httpd/error_log
Permission denied / connection refused mixed with AVC lines usually means stack the fixes: network/firewall, file context, port type, and boolean as indicated.
setroubleshoot awareness
On full GUI or richly installed systems, setroubleshoot may log friendly messages in the journal pointing at sealert . Minimal exam images might have thinner tooling— ausearch always remains the core skill; sealert when present accelerates boolean discovery. rpm -q setroubleshoot-server setroubleshoot-plugins 2>/dev/null
- Persistence verification mindset sudo setsebool -P httpd_can_network_connect on
- getsebool httpd_can_network_connect
- sudo semanage boolean -l | grep httpd_can_network_connect
- After practice reboots in a lab: getenforce
- getsebool httpd_can_network_connect
- # must still be on if -P was used
If a boolean reverts, you likely used setsebool without -P .
- Exam workflows
- Workflow A — Allow httpd outbound connects (persistent) getsebool httpd_can_network_connect
- sudo setsebool -P httpd_can_network_connect on
- getsebool httpd_can_network_connect
- # exercise the app feature that opens a backend TCP connection
- Workflow B — Serve public_html / home content getsebool httpd_enable_homedirs
- sudo setsebool -P httpd_enable_homedirs on
- # ensure home public_html exists, permissions, and correct SELinux file contexts
- sudo systemctl reload httpd
File contexts for user content may still need httpd_user_content_t (or related) via restorecon/fcontext—boolean alone is not always sufficient.
- Workflow C — Web content on NFS getsebool httpd_use_nfs
- sudo setsebool -P httpd_use_nfs on
- getsebool httpd_use_nfs
- # mount NFS export; fix fcontext if content types still wrong
- Workflow D — Denial → boolean sudo ausearch -m avc -ts recent
- # note denied capability / suggested bool
- getsebool -a | grep httpd
- sudo setsebool -P httpd_can_network_connect on
- getenforce
- Workflow E — Turn something off if the task requires hardening sudo setsebool -P httpd_enable_homedirs off
- getsebool httpd_enable_homedirs
Most tasks enable features; read carefully if the requirement is to disable a boolean.
Common traps
setsebool without -P — works until reboot, then fails grading.
Enabling a boolean but leaving file contexts or port types wrong.
Guessing boolean names without getsebool -a | grep .
Setting Permissive or disabled instead of the boolean.
Fixing firewalld only when the denial is clearly SELinux.
Applying unrelated booleans broadly “just in case.”
Forgetting to retest the application after the change.
Confusing httpd_can_network_connect (outbound) with port labels (bind).
Ignoring sealert suggestions when available.
Assuming boolean changes require editing /etc/selinux/config — they do not.
Relationship to other sections
- Skill Section
- Modes Enforcing/Permissive 20.x
- File/process contexts 20.x
- Port labels 21.1
- Booleans 21.2 (this)
- firewalld security/networking
- NFS mounts / httpd content filesystems / services
- Section checkpoint
You should discover booleans with getsebool -a | grep , read values with getsebool NAME , enable or disable with setsebool , make exam-grade lasting changes with setsebool -P , recognize common httpd_ * and NFS-related toggles (especially httpd_can_network_connect ), and use ausearch / sealert to pick the right switch—while keeping SELinux Enforcing . That meets the EX200 objective to use Boolean settings to modify SELinux settings on RHEL 10.