7.7 KiB
7.7 KiB
Mock RHCSA (EX200) Practice Exam - Version 2
Introduction
This is the second version of our mock RHCSA exam, featuring new tasks to further test your Red Hat system administration skills. Like the first version, it covers the key objectives of the official RHCSA exam (EX200).
Exam Guidelines:
- Duration: 2.5 hours
- All configurations must persist after system reboot
- Complete as many tasks as possible - 70% is the passing score
- You may use Red Hat documentation available on the system
Exam Environment:
- Red Hat Enterprise Linux 9
- Virtual machine with 4GB RAM, 40GB disk space
- Internet access is NOT available
- Root access is available
Exam Tasks
Task 1: User and Group Management
- Create a user named
devopswith UID 3030 - Set the password for
devopstoDevOps2023 - Configure the
devopsaccount to expire on December 31, 2023 - Create a group named
developerswith GID 4040 - Create 3 users:
dev1,dev2, anddev3, all belonging to thedevelopersgroup as their primary group - Ensure the primary group for all new users created in the system is
developers - Configure all members of the
developersgroup to have a password change required every 60 days
Task 2: File System Management
- Create a directory
/projectsowned bydevopswithdevelopersas the group owner - Set special permissions on the
/projectsdirectory so all new files created within it inherit thedevelopersgroup ownership - Configure permissions so that:
- Members of the
developersgroup can create files in the directory - Only file owners can delete their own files (using the sticky bit)
- Users outside the
developersgroup cannot access the directory
- Members of the
- Create a file
/projects/readme.mdwith the content "Development Projects Directory" - Set ACLs on the
/projectsdirectory to give userdev1full control, whiledev2anddev3have read and execute permissions only
Task 3: LVM Storage Configuration
- Create a 2GB partition on an available disk
- Create a volume group named
vg_projectsusing this partition - Create two logical volumes in the
vg_projectsvolume group:lv_data(800MB)lv_backup(400MB)
- Format
lv_datawith XFS filesystem andlv_backupwith ext4 filesystem - Mount
lv_dataat/projects/dataandlv_backupat/projects/backuppermanently - Configure the system to automatically snapshot
lv_datadaily (hint: you'll need to leave free space in the volume group)
Task 4: Storage with VDO and Stratis
- Install the necessary packages for VDO (Virtual Data Optimizer)
- Create a 1GB partition on an available disk
- Configure VDO on this partition with a logical size of 3GB
- Format the VDO volume with XFS and mount it at
/vdopermanently - Install the Stratis storage management tools
- Create a Stratis pool named
stratis_poolusing another 1GB partition - Create a Stratis filesystem named
stratis_fsand mount it at/stratispermanently
Task 5: Advanced Container Management
- Install the container tools (podman)
- Configure a persistent container storage location at
/container_storage - Pull the MariaDB container image
- Run a MariaDB container named
db_serverwith:- The container accessible on port 3306
- A root password of
dbpassword - A persistent volume at
/container_storage/mysql_datamounted to the container's/var/lib/mysql - Environment variables set for a database named
webappand a database userwebuserwith passwordwebpass
- Configure the container to start automatically at system boot using systemd
- Create a simple bash script
/usr/local/bin/db_backup.shthat creates a backup of the MariaDB container data
Task 6: Automating System Tasks
- Create a systemd timer that runs a filesystem usage check every 4 hours and logs the results to
/var/log/disk_usage.log - Configure a cron job for the
devopsuser to run every Monday at 2:30 AM that:- Archives files older than 30 days in
/projects/data - Moves the archives to
/projects/backup
- Archives files older than 30 days in
- Configure a systemd service called
project-backupthat:- Creates a tar archive of the
/projectsdirectory - Runs automatically at system shutdown
- Places the backup in
/var/backupswith a timestamp in the filename
- Creates a tar archive of the
Task 7: System Boot Configuration
- Configure the system to boot into emergency mode with a 5-second timeout
- Create a new GRUB menu entry that boots the system with the kernel parameter
enforcing=0 - Set the default boot target to multi-user (non-graphical)
- Create a custom systemd target called
developer-mode.targetthat:- Starts all the services of multi-user target
- Additionally starts the MariaDB container
- Mounts all project-related filesystems
Task 8: Network Configuration and Services
- Configure the primary network interface with:
- Static IP: 192.168.10.200/24
- Gateway: 192.168.10.1
- DNS servers: 192.168.10.1 and 8.8.8.8
- Configure the hostname as
rhcsa-server - Add a second IP address (192.168.10.201/24) to the same interface
- Install and configure an NFS server that:
- Exports
/projects/dataas read-write to 192.168.10.0/24 - Exports
/projects/backupas read-only to 192.168.10.0/24
- Exports
- Configure the firewall to allow NFS and MariaDB traffic from the local network only
Task 9: Security Configuration
- Configure SELinux contexts so that:
- The web server can access files in
/projects/data - The MariaDB container can access
/container_storage/mysql_data
- The web server can access files in
- Configure SSH to:
- Allow access only for the
devopsuser - Disable password authentication (key-based only)
- Listen on an alternate port (2222)
- Allow access only for the
- Set up key-based authentication for the
devopsuser - Configure the firewall to allow SSH on the new port
- Create a sudo configuration that allows
devopsto run commands as root without a password, but logs all commands
Task 10: System Analysis and Troubleshooting
- Configure system logging to:
- Keep logs for 90 days
- Forward system and audit logs to the
rsyslogservice - Create separate log files for container operations
- Create a script
/usr/local/bin/system_health.shthat:- Checks system load average
- Monitors memory usage
- Verifies connectivity to the gateway
- Reports if any key services are down
- Emails the report to
root@localhost
- Create a systemd service and timer to run this health check script every hour
Task 11: Advanced Shell Scripting
- Create a script
/usr/local/bin/user_report.shthat:- Finds all users in the
developersgroup - Reports their last login time
- Lists all files owned by each user in the
/projectsdirectory - Sorts the output by file size
- Saves a formatted report to
/var/reports/user_report.txt
- Finds all users in the
- Make the script executable and set up a weekly cron job to run it
- Create a directory
/var/reportswith appropriate permissions for storing reports
Task 12: Advanced FileSystem Management
- Create a 500MB file using
ddto serve as a loopback device - Configure this file as a loopback device
- Create a LUKS encrypted container on the loopback device
- Format the encrypted container with XFS
- Configure the system to automatically unlock the encrypted container at boot using a key file
- Mount the encrypted filesystem at
/projects/securepermanently
Scoring Guide
Each task has approximately equal weight. To pass this mock exam, you need to successfully complete 70% of the tasks.
After completing the exam, test your configurations by:
- Rebooting the system to verify persistence
- Logging in as the created users to verify access
- Testing that services start correctly
- Verifying container operation
- Checking encrypted storage and mounts
Good luck with your practice exam!