Skip to content

Day 2 Practice Exam Paper: Services, SSH, and Network Identity

Note: This is a practice paper written in the style of a hands-on, performance-based exam. It is not a real exam, does not reproduce real exam questions, and its point values are for self-assessment only. Building a virtual machine is lab preparation, so this paper tests the administration tasks you perform on the VM. Confirm the actual exam format and objectives on Red Hat's official EX200 page.


Exam Information

Item Detail
Suggested time 60 minutes
Total points 60 (self-assessed)
Environment Your own RHEL 9 or 10 practice VM (a snapshot taken first is recommended)
Account root, or a regular user with sudo. Examples use sudo
Resources allowed Manual pages (man) only

Instructions

  1. Work only on your private practice VM. Take a snapshot before you start.
  2. Perform every task from the command line.
  3. Grading is on the end result. Changes marked persistent must survive a reboot.
  4. Files go in /root/exam2 unless stated. Task 1 creates it.
  5. Keep a second SSH or console session open while changing SSH settings, so a mistake cannot lock you out.
  6. Do not disable SELinux or the firewall.
  7. Placeholders such as <user> and <IP-address> stand for values from your own VM.

Tasks

Task 1 (2 points) Create the directory /root/exam2.

Task 2 (4 points) Ensure the SSH service (sshd) is running now and is enabled to start at boot.

Task 3 (4 points) Ensure the firewall permanently allows the ssh service, and that this rule is active now. The firewall must remain enabled.

Task 4 (3 points) Save the IP address or addresses of the VM to /root/exam2/ip.txt.

Task 5 (3 points) Save the hostname of the VM to /root/exam2/host.txt.

Task 6 (2 points) Save the operating system name and version line (PRETTY_NAME) to /root/exam2/os.txt.

Task 7 (3 points) Create a backup of the SSH server configuration file at /root/exam2/sshd_config.orig. The backup must be identical to the original.

Task 8 (6 points) Configure the SSH server so that the root user cannot log in over SSH at all, while password authentication for regular users remains enabled. The configuration must pass the server's syntax check. The change must be persistent.

Task 9 (4 points) Save the effective values (the settings the server will actually use) of PermitRootLogin and PasswordAuthentication to /root/exam2/effective.txt. Save only those two settings.

Task 10 (3 points) Apply the new SSH configuration without a full service restart, so existing connections are not interrupted. Confirm that sshd is still active.

Task 11 (5 points) Using the additional-configuration directory for the SSH server (not the main file), create a file named 99-exam.conf that limits authentication attempts per connection to 3. Confirm that the effective value is 3 and save the effective line to /root/exam2/maxauth.txt. The change must be persistent.

Task 12 (4 points) Save the last 20 log lines of the sshd service from the systemd journal to /root/exam2/sshd-log.txt.

Task 13 (5 points) Prove that a regular user can still log in over SSH: from a second terminal or your host, connect as <user> to the VM, run whoami, and exit. Then save the text ssh login verified for <user> (using the real user name) to /root/exam2/login.txt.

Task 14 (4 points) Using only the additional-configuration directory approach, remove the change from Task 11 so the setting returns to the server default. Apply the change, and save the new effective maxauthtries line to /root/exam2/after.txt.

Task 15 (4 points) Restore the SSH main configuration file from your backup. Confirm that the configuration passes the syntax check, apply it, and confirm that sshd is active and enabled.

Task 16 (4 points) On your host computer (not the VM): the VM was reinstalled and now shows a changed-host-key warning for its IP address. Remove the saved host key entry for <IP-address> from your SSH client's known hosts.


Self-Check Before You Finish

  • [ ] sshd is active and enabled, and the firewall allows ssh permanently.
  • [ ] sudo sshd -t prints nothing (valid configuration).
  • [ ] Root cannot log in over SSH while the Task 8 setting is active, and a regular user can.
  • [ ] Every file in /root/exam2 contains exactly what was requested.
  • [ ] After a reboot, services and settings marked persistent are still in place.

Answer Key and Marking Guide

Try the paper first. Output varies by system, so compare meaning, not exact text. Replace placeholders with your own values.

Task Solution
1 sudo mkdir /root/exam2 (run sudo -i for a root shell to make later commands shorter)
2 sudo systemctl enable --now sshd
3 sudo firewall-cmd --permanent --add-service=ssh then sudo firewall-cmd --reload
4 hostname -I > /root/exam2/ip.txt
5 hostname > /root/exam2/host.txt
6 grep PRETTY_NAME /etc/os-release > /root/exam2/os.txt
7 cp /etc/ssh/sshd_config /root/exam2/sshd_config.orig

Redirecting into /root with sudo: sudo hostname > /root/exam2/host.txt fails because the redirection runs as your normal user. Either work in a root shell (sudo -i) or use echo ... | sudo tee /root/exam2/file. The tasks above assume a root shell.

Verification for Tasks 2 and 3

systemctl is-active sshd
systemctl is-enabled sshd
firewall-cmd --list-services
firewall-cmd --permanent --list-services

ssh must appear in both firewall lists.

Task 8 solution

vim /etc/ssh/sshd_config

Set (remove any # in front):

PermitRootLogin no
PasswordAuthentication yes

If a file in /etc/ssh/sshd_config.d/ sets these options, edit it too, because the first value read wins. Then:

sshd -t
sshd -T | grep -Ei 'permitrootlogin|passwordauthentication'

Task 9 solution

sshd -T | grep -Ei '^(permitrootlogin|passwordauthentication) ' > /root/exam2/effective.txt
cat /root/exam2/effective.txt

The file should contain exactly two lines (permitrootlogin no and passwordauthentication yes).

Task 10 solution

systemctl reload sshd
systemctl is-active sshd

reload makes the service re-read its configuration without dropping existing sessions.

Task 11 solution

echo "MaxAuthTries 3" > /etc/ssh/sshd_config.d/99-exam.conf
sshd -t
systemctl reload sshd
sshd -T | grep -i '^maxauthtries' | tee /root/exam2/maxauth.txt

Expected effective line: maxauthtries 3. Drop-in files in /etc/ssh/sshd_config.d/ are read when the service starts or reloads, so the change persists across reboots.

Task 12 solution

journalctl -u sshd -n 20 > /root/exam2/sshd-log.txt

Task 13 solution

From a second terminal or your host:

ssh <user>@<IP-address>
whoami
exit

Then, in the root shell on the VM:

echo "ssh login verified for <user>" > /root/exam2/login.txt

Use the real user name in place of <user>. Note that Task 8 blocks root, so the test must use the regular user.

Task 14 solution

rm /etc/ssh/sshd_config.d/99-exam.conf
sshd -t
systemctl reload sshd
sshd -T | grep -i '^maxauthtries' > /root/exam2/after.txt

The value should return to the server default (check your system's value, since the default is set by the software).

Warning: Remove only the file you created.

Task 15 solution

cp /root/exam2/sshd_config.orig /etc/ssh/sshd_config
sshd -t
systemctl restart sshd
systemctl is-active sshd
systemctl is-enabled sshd

Task 16 solution (on the host)

ssh-keygen -R <IP-address>

This removes the old entry from ~/.ssh/known_hosts. Only do this after confirming that the VM really was reinstalled.

Common mistakes

  • Editing only the main file when a drop-in overrides it. Always confirm with sshd -T.
  • Restarting before running sshd -t.
  • Using > where an append (>>) was needed.
  • Forgetting --permanent for the firewall rule, so it disappears after a reboot.
  • Testing the SSH login from an already-open session instead of a new one.

Final reboot check: Run sudo reboot, then confirm systemctl is-active sshd, firewall-cmd --list-services, and sshd -T | grep -i permitrootlogin still show the expected results.

Scoring (self-assessment)

Score Level
54 to 60 Excellent
42 to 53 Good. Review missed tasks
Below 42 Repeat the Day 2 lab and drills