RHCSA Mock Exam 1
Full EX200-style exam on servera (RHEL 10), 20 tasks, 150 minutes. Exam rules: work as root (`sudo -i`) on servera; serverb is the file/SSH server and needs no changes. **Everything must survive a reboot**: the marking happens after the machine is restarted, so a change that only exists in memory (runtime firewall rule, setenforce, mount without fstab, service started but not enabled) scores nothing. Do not change the root password except in the task that asks for it, and do not disable SELinux. Scenario: you are building `exam1`, the new monitoring host for the WebAsha NOC.
Tasks
- The root password of servera is unknown. Reset it to NocRoot@1 from the boot loader, and make sure root can log in afterwards with SELinux enforcing.
- Configure connection eth1 persistently: keep 172.25.250.10/24 and add 172.25.250.31/24, gateway 172.25.250.254, DNS 172.25.250.254, and the static IPv6 address fd00:250::31/64. Set the host name to exam1.lab.example.com.
- Configure servera to use the RPM repository at file:///opt/noc-repo (unsigned packages, enabled), and install the package webasha-monitor from it.
- Add the system-wide Flatpak remote nochub for file:///opt/noc-flatpak (not GPG-signed) and install the application com.webasha.Dashboard from it.
- Create group sysops (GID 4100); users natasha and harry with sysops as a supplementary group; user sarah with no interactive shell and not in sysops. All three passwords: Rhcsa@123. Members of sysops may run any command as root through sudo without a password.
- Passwords of all new users must expire after 60 days. Also make harry's current password expire after 60 days.
- Create /common/sysops, owned by group sysops, so that only root and members of sysops can use it (full access) and new files in it automatically belong to sysops.
- Give natasha a default umask of 027 for login shells. Then set up key-based SSH so that student on servera can log in to serverb without a password.
- Find all regular files on the system owned by user contractor and copy them (just the files, no directory tree) into the directory /root/found. Then create a gzip-compressed tar archive /root/sysconfig.tar.gz of the directory /etc/sysconfig.
- Write the executable script /usr/local/bin/lsshell.sh. Given a shell path as its only argument (for example /bin/bash), it prints the names of all users whose login shell is exactly that path, one per line, sorted. Without an argument it prints a message containing Usage and exits with status 2.
- As user natasha, run logger EX200-check every 5 minutes through her crontab.
- Make chronyd synchronise with classroom.lab.example.com (with iburst) instead of the default pool, enabled at boot, and set the time zone to Asia/Kolkata.
- Apply the tuning profile that tuned recommends for this machine, with tuned enabled at boot. Also make the systemd journal persistent across reboots.
- Create volume group examvg on /dev/vdb with a physical extent size of 16 MiB. In it create logical volume examlv of exactly 30 extents, format it with ext4, and mount it on /exam/data at boot (by UUID).
- The logical volume vgexam1/lvhome mounted on /exthome is too small. Resize it and its file system to between 650 and 750 MiB without losing data.
- Create a 512 MiB partition on /dev/vdc and use it as swap, active now and at boot (by UUID). Do not touch any other swap.
- Mount serverb:/exports/shared on /mnt/noc permanently with NFS. Configure autofs so that /rhome/<user mounts serverb:/exports/homes/<user read-write on demand (for example /rhome/student1); autofs must start at boot.
- The web server on servera is configured to serve /var/www/html on port 82, but it does not work. Fix it without changing the Apache configuration or the port: curl http://servera:82/ must return the page, httpd must start at boot, the port must be open in the firewall permanently, and SELinux must be enforcing (now and after reboot).
- servera is a server: make it boot into multi-user.target by default, and add the kernel argument auditbackloglimit=8192 persistently to all installed kernels.
- Reboot servera and make sure everything still works: the machine must come up normally (no emergency mode) and every task above must still be complete after the reboot.