RHCSA Mock Exam 3

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: `exam3` is the QA build agent for the WebAsha app team. Work fast, then verify everything after the reboot.

Tasks

  1. The root password of servera is unknown. Reset it to QaBuild-33 from the boot loader, and make sure root can log in afterwards with SELinux enforcing.
  2. Configure connection eth1 persistently: keep 172.25.250.10/24 and add 172.25.250.53/24, gateway 172.25.250.254, DNS 172.25.250.254, and the static IPv6 address fd00:250::53/64. Set the host name to exam3.lab.example.com.
  3. Configure servera to use the RPM repository at file:///opt/qa-repo (unsigned packages, enabled), and install the package webasha-qa from it.
  4. Add the system-wide Flatpak remote qatools for file:///opt/qa-flatpak (not GPG-signed) and install the application com.webasha.Tester from it.
  5. Create group qa (GID 6300); users tanvi and rohan with qa as a supplementary group; user guest1 with no interactive shell and not in qa. All three passwords: Qa@Pass99. Members of qa may run any command as root through sudo without a password.
  6. Passwords of all new users must expire after 30 days. Also make rohan's current password expire after 30 days.
  7. Create /qa/shared, owned by group qa, so that only root and members of qa can use it (full access) and new files in it automatically belong to qa.
  8. Give tanvi a default umask of 007 for login shells. Then set up key-based SSH so that student on servera can log in to serverb without a password.
  9. Find all files below /usr/share/qa-data that are owned by user auditor and are larger than 10 KiB, and write their full paths, sorted, to /root/auditor-files.txt. Then create a xz-compressed tar archive /root/ssh-config.tar.xz of the directory /etc/ssh.
  10. Write the executable script /usr/local/bin/countlines.sh. For each file given as an argument it prints <file: <number of lines, one per line. If no argument is given it prints a message containing Usage and exits with status 1.
  11. As user tanvi, run /usr/local/bin/countlines.sh /etc/passwd /home/tanvi/count.log at 14:23 every day through her crontab.
  12. Make chronyd synchronise with classroom.lab.example.com (with iburst) instead of the default pool, enabled at boot, and set the time zone to America/NewYork.
  13. Apply the tuning profile virtual-guest, with tuned enabled at boot. Also make the systemd journal persistent across reboots.
  14. Create volume group qavg on /dev/vdb with a physical extent size of 4 MiB. In it create logical volume qalv of exactly 100 extents, format it with ext4, and mount it on /qa/builds at boot (by UUID).
  15. The logical volume vgexam3/lvdb mounted on /qadb is too small. Resize it and its file system to between 570 and 630 MiB without losing data.
  16. Create a 256 MiB partition on /dev/vdd and use it as swap, active now and at boot (by UUID). Do not touch any other swap.
  17. Mount serverb:/exports/shared on /mnt/qa-shared permanently with NFS. Configure autofs so that /qahome/<user mounts serverb:/exports/homes/<user read-write on demand (for example /qahome/student1); autofs must start at boot.
  18. The web server on servera is configured to serve /var/www/html on port 8999, but it does not work. Fix it without changing the Apache configuration or the port: curl http://servera:8999/ 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).
  19. Make servera boot into multi-user.target by default, and set the GRUB menu timeout to 8 seconds (regenerate the GRUB configuration).
  20. 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.