Hands-on labs aligned with the Red Hat Certified System Administrator (EX200) exam. SELinux enforcement, systemd service management, and firewall configuration with firewalld.
SELinux policy enforcement, systemd service management, and host-based firewall configuration — core RHCSA (EX200) skills.
Lab 16: SELinux Management
Intermediate / Terminal + GUI
Scenario: Resolve a Web Server SELinux Denial
A web server is failing to serve content from a non-standard directory. You must check SELinux status, identify the current mode, view denials in the audit log, apply the correct file context label, and restore contexts. Finally, verify that the boolean for httpd home directories is enabled. These tasks are tested heavily on the RHCSA exam.
Learning Objectives:
RHCSA EX200 — SELinux
Status: Check SELinux mode and policy type
Audit: Read SELinux denial messages from audit.log
Contexts: Apply and restore file security contexts
Booleans: Enable SELinux booleans for httpd
📋 Step-by-Step Instructions
Step 1: Check SELinux Status and Mode
🎯 Goal: Confirm SELinux is enforcing and identify policy type
💻 Show full status: sestatus
💻 Show current mode: getenforce
💡 Tip: RHCSA requires that SELinux is Enforcing at exam end. Never leave it in Permissive/Disabled.
Step 2: View SELinux Denials in audit.log
🎯 Goal: Identify the denial preventing httpd from accessing content
🎓 Checkpoint: You resolved an SELinux denial, applied persistent labels, and set a boolean — key RHCSA skills.
Linux Terminal
Terminal
SELinux Dashboard
Audit Viewer
Activity Log
root@rhcsahost:~#
SELinux Status
ModeUnknown
PolicyUnknown
/web/content ContextNot checked
httpd_enable_homedirsoff
Context Policy Rules (fcontext)
No custom rules added yet.
Recent AVC Denials
No audit data viewed yet. Run ausearch to populate.
Recent Activity
[--:--:--]Lab session started. Ready for commands.
Progress:0/6 tasks completed
Score: 0/100
🎉 After Completing All Steps:
1. Click "Validate Configuration" to check what is done vs pending. 2. Use SELinux Dashboard and Audit Viewer to verify status visually. Tip: On the real RHCSA exam, leaving SELinux disabled means an automatic fail.
Lab 17: Systemd Service Management
Intermediate / Terminal + GUI
Scenario: Deploy and Manage a Custom Application Service
A new internal application needs to run as a systemd service. You must create a unit file, reload the daemon, enable the service, start it, verify its status, and check its journal logs. This is a common RHCSA task that tests your understanding of the systemd service lifecycle.
Learning Objectives:
RHCSA EX200 — Systemd
Unit Files: Create and install a custom systemd service file
🎓 Checkpoint: You deployed, managed, and inspected a systemd service end-to-end — essential for RHCSA.
Linux Terminal
Terminal
Service Dashboard
Unit File Viewer
Activity Log
root@rhcsahost:~#
Service Status
Unit File DeployedNo
Daemon ReloadedNo
Enabled at BootNo
Active Stateinactive
System Services (Excerpt)
ServiceEnabledActiveDescription
/etc/systemd/system/myapp.service
# Unit file not deployed yet
Recent Activity
[--:--:--]Lab session started. Ready for commands.
Progress:0/6 tasks completed
Score: 0/100
🎉 After Completing All Steps:
1. Validate configuration for status of each task. 2. Use Service Dashboard and Unit File Viewer to inspect state. Tip: The service lifecycle is: deploy → daemon-reload → enable → start → verify → stop.
Lab 18: Firewall Configuration with firewalld
Intermediate / Terminal + GUI
Scenario: Secure a Multi-Service Host
A server runs SSH, HTTP, and HTTPS. You must verify firewalld is active, check the default zone, add required services, open a custom port for a monitoring agent, make the rules permanent, and verify the final configuration. Firewall management with firewall-cmd is a core RHCSA objective.
Learning Objectives:
RHCSA EX200 — Firewall
Service State: Verify firewalld is running and check default zone
Service Rules: Add HTTP and HTTPS services to the public zone
Port Rules: Open a custom TCP port for monitoring
Persistence: Make runtime rules permanent and reload
📋 Step-by-Step Instructions
Step 1: Verify firewalld Status and Default Zone
🎯 Goal: Confirm firewalld is running and identify the default zone
💻 Check service: sudo systemctl status firewalld --no-pager
💻 Show default zone: sudo firewall-cmd --get-default-zone
💡 Tip: On RHEL, the default zone is usually public. Always verify before adding rules.
Step 2: List Currently Allowed Services
🎯 Goal: See what services are already allowed in the public zone
💻 List services: sudo firewall-cmd --zone=public --list-services
💡 Tip: SSH is usually pre-allowed. HTTP and HTTPS need to be added manually.
💻 List open ports: sudo firewall-cmd --zone=public --list-ports
💡 Tip: Use --list-ports to verify. Named services and explicit ports are tracked separately.
Step 5: Make Rules Permanent and Reload
🎯 Goal: Persist runtime rules so they survive a reboot
💻 Save runtime to permanent: sudo firewall-cmd --runtime-to-permanent
💻 Reload firewall: sudo firewall-cmd --reload
⚠️ Exam Note: Forgetting --runtime-to-permanent or --permanent means rules are lost on reboot. This is a common RHCSA mistake.
Step 6: Verify Final Firewall Configuration
🎯 Goal: Confirm all services and ports are listed
💻 List all info for public zone: sudo firewall-cmd --zone=public --list-all
🎓 Checkpoint: You configured firewalld with services, ports, and persistence — a core RHCSA firewall skill.
Linux Terminal
Terminal
Firewall Dashboard
Zone Viewer
Activity Log
root@rhcsahost:~#
Firewall Status
firewalldUnknown
Default ZoneUnknown
Permanent SavedNo
Allowed Services & Ports
TypeName/PortZone
public Zone Configuration
Run firewall-cmd --list-all to populate this view.
Recent Activity
[--:--:--]Lab session started. Ready for commands.
Progress:0/6 tasks completed
Score: 0/100
🎉 After Completing All Steps:
1. Validate configuration to check all rules are in place. 2. Use Firewall Dashboard + Zone Viewer for a visual summary. Tip: Always persist rules for the exam — runtime-only rules vanish on reboot.
Modal
Confirm Reset
Are you sure you want to reset this lab? This will:
Clear all terminal output
Reset all completed tasks
Reset SELinux, service, and firewall simulated configurations