A realistic command-line RHCSA (Red Hat Certified System Administrator) exam simulator that generates exam tasks, validates your system configuration, and tracks your progress over time.
- Learn Mode: Study RHCSA concepts with detailed explanations, command syntax, examples, common mistakes, and exam tricks
- Guided Practice: Practice tasks with progressive 3-level hints (concept → command structure → full solution)
- Command Recall Training: Build muscle memory by typing commands before execution with instant accuracy feedback
- Full Exam Mode: Simulates a complete RHCSA exam with 15-20 tasks covering all objectives
- Practice Mode: Focus on specific categories (Users, LVM, SELinux, etc.) at different difficulty levels
- Automatic Validation: Validates your system configuration using safe, read-only commands
- Adaptive Feedback: Explains what was expected vs. what was found for each failed check
- Progress Tracking: Saves exam results and displays statistics over time
- Timer Support: Optional 2.5-hour timer to simulate real exam conditions
- Offline Operation: No internet connection required
- Safe & Secure: Uses command whitelisting and validation-only approach
- Intelligent Analysis: Line-by-line command analysis using Claude AI
- Smart Explanations: Understands WHY you failed, not just that you failed
- Approach Comparison: Compares your solution to optimal approaches
- Contextual Tips: RHCSA exam tips personalized to each task
- Command Tracking: Automatically tracks and categorizes commands you execute
Setup: See AI_SETUP.md for configuration instructions (requires Anthropic API key)
- OS: RHEL 8/9, Rocky Linux 8/9, or Alma Linux 8/9
- Python: 3.6 or later (included in RHEL 8/9)
- Privileges: Must run as root (uses
sudo) - Dependencies: None (uses Python standard library only)
# Download or clone the repository
cd rhcsa-simulator
# Run installation script
sudo ./install.shThe installer will:
- Check Python version
- Copy files to
/opt/rhcsa-simulator - Create symlink at
/usr/local/bin/rhcsa-simulator - Set proper permissions
sudo mkdir -p /opt/rhcsa-simulator
sudo cp -r * /opt/rhcsa-simulator/
sudo chmod +x /opt/rhcsa-simulator/rhcsa_simulator.py
sudo ln -s /opt/rhcsa-simulator/rhcsa_simulator.py /usr/local/bin/rhcsa-simulatorsudo rhcsa-simulatorNote: Root privileges are required to validate system state (users, services, permissions, etc.)
- Select "Exam Mode" from main menu
- Review exam information (tasks, duration, pass threshold)
- Press Enter to generate exam tasks
- Read all tasks carefully
- Complete tasks on your Linux system
- Return to simulator and press Enter to validate
- Review your results and detailed feedback
- Select "Learn Mode" from main menu
- Choose a topic to study
- Review:
- Concept explanations
- Command syntax with examples
- Common mistakes to avoid
- Exam-specific tricks and tips
- Optionally jump to practice mode for that topic
- Select "Guided Practice" from main menu
- Choose a category and difficulty level
- Read each task carefully
- Use progressive hints if needed:
- Hint 1: Concept reminder
- Hint 2: Command structure and syntax
- Hint 3: Full solution with examples
- Complete task and get adaptive feedback
- Review detailed explanations for any failures
- Select "Command Recall" from main menu
- Choose a category and difficulty level
- Read the task description
- Type the command(s) you would use
- Get instant feedback on command accuracy
- Build muscle memory and improve speed
- Select "Practice Mode" from main menu
- Choose a category:
- Users & Groups
- Permissions & ACLs
- LVM (Logical Volume Management)
- SELinux
- Services (systemd)
- And more...
- Select difficulty level (easy/exam/hard)
- Complete each task and get immediate feedback (no hints)
Track your improvement over time:
- Overall statistics (average score, pass rate)
- Recent exam results
- Performance by category
For best results, follow this progression:
-
Learn - Study each topic with Learn Mode
- Understand concepts before practicing
- Review command syntax and examples
- Learn common mistakes and exam tricks
-
Guided Practice - Build confidence with hints
- Start practicing tasks with support
- Use hints when stuck
- Learn from adaptive feedback
-
Command Recall - Build muscle memory
- Practice typing commands from memory
- Improve speed and accuracy
- Build exam-day confidence
-
Practice Mode - Test without hints
- Validate your knowledge independently
- Identify weak areas
- Build problem-solving skills
-
Exam Mode - Full exam simulation
- Take complete timed exams
- Simulate real exam pressure
- Track your progress over time
Pro Tip: Cycle through topics rather than mastering one at a time. This improves retention and helps you see connections between different RHCSA objectives.
The simulator covers all RHCSA exam objectives:
- Essential Tools - find, grep, tar, archives
- Users & Groups - user/group management, sudo
- Permissions - chmod, chown, ACLs, special bits
- LVM - physical volumes, volume groups, logical volumes
- File Systems - create, mount, fstab, XFS, ext4
- Networking - interface configuration, DNS, hostnames
- SELinux - contexts, booleans, modes
- Services - systemd service management
- Boot Targets - multi-user, graphical targets
- Processes - process management, priorities
- Scheduling - cron, at, systemd timers
- Containers - Podman basics
Task: Create a user named 'examuser42' with the following requirements:
- UID: 2500
- Primary group: developers
- Supplementary groups: wheel, sysadmin
- Home directory: /home/examuser42
- Login shell: /bin/bash
Task: Configure SELinux context for directory '/srv/web01':
- Set SELinux type to: httpd_sys_content_t
- Apply context recursively to all files
- Make the change persistent across relabels
Task: Configure the 'httpd' service:
- Start the service
- Enable the service to start at boot
The simulator uses read-only validation:
- Does NOT modify your system
- Only checks if tasks were completed correctly
- Uses safe, whitelisted commands (
id,ls,systemctl status, etc.) - All commands have timeout protection
- Command injection prevention
- Each task has a point value (4-12 points typically)
- Tasks have multiple validation checks
- Partial credit is awarded for partial completion
- Pass threshold: 70% (configurable)
Results are saved to JSON files in /opt/rhcsa-simulator/data/results/:
- Exam ID and timestamp
- Task-by-task results
- Category breakdown
- Total score and pass/fail status
rhcsa-simulator/
├── rhcsa_simulator.py # Main entry point
├── config/ # Configuration
├── core/ # Orchestration (exam, practice, menu, results)
├── tasks/ # Task categories (20+ task types)
├── validators/ # Validation framework
├── utils/ # Utilities (logging, formatting, helpers)
└── data/ # Results storage
- Open the appropriate category file (e.g.,
tasks/users_groups.py) - Create a new class extending
BaseTask - Register with
@TaskRegistry.register("category_name") - Implement
generate()andvalidate()methods
Example:
@TaskRegistry.register("users_groups")
class MyNewTask(BaseTask):
def __init__(self):
super().__init__(
id="my_task_001",
category="users_groups",
difficulty="exam",
points=8
)
def generate(self, **params):
self.description = "Task description here"
self.hints = ["Hint 1", "Hint 2"]
return self
def validate(self):
checks = []
# Add validation checks
return ValidationResult(self.id, passed, score, max_score, checks)- Command Whitelisting: Only approved read-only commands
- Timeout Protection: All commands have 5-second timeout
- Pattern Blocking: Detects dangerous patterns (rm -rf, etc.)
- No System Modifications: Validation is read-only
- Root Required: Needed to check system state, not to modify it
sudo rhcsa-simulator # Don't forget sudo!# Ensure you're in the correct directory
cd /opt/rhcsa-simulator
sudo python3 rhcsa_simulator.py- Run
sudo rhcsa-simulatorto initialize task registry - Check logs at
/opt/rhcsa-simulator/data/logs/rhcsa_simulator.log
- Lines of Code: ~5,500
- Task Categories: 12
- Task Types: 20+ implemented, expandable to 100+
- Validators: 50+ validation functions
- Dependencies: 0 (Python stdlib only)
# Run from project root
cd /opt/rhcsa-simulator
sudo python3 -c "
from tasks.registry import TaskRegistry
TaskRegistry.initialize()
TaskRegistry.print_statistics()
"To add more tasks:
- Choose a category or create a new one
- Follow the pattern in
tasks/users_groups.py - Use existing validators from
validators/modules - Test thoroughly on a test system
This is an educational tool for RHCSA exam preparation. Use at your own risk on test systems only.
- This simulator is NOT affiliated with Red Hat
- Practice on test systems only
- Always backup important data
- Validation commands are safe but require root to check system state
v2.0.0 - AI-Powered Feedback Release
- Added AI-powered intelligent feedback using Claude API
- Command history tracking and analysis
- Line-by-line approach comparison
- Contextual failure explanations
- Complete RHCSA exam coverage (all 12 categories)
v1.0.0 - Initial release
Good luck with your RHCSA certification! 🎓