RHCSA RHCSA EX200 2 — Questions and Answers
Question 1: Which command resets a forgotten root password in RHEL 8 by interrupting the boot process and appending 'rd.break' to the kernel line?
- grub2-mkconfig
- Editing the GRUB entry at boot (Correct answer)
- dracut --force
- systemctl rescue
Correct answer: Editing the GRUB entry at boot
Appending 'rd.break' to the kernel line in the GRUB editor drops you into an early shell before root mounts, allowing a password reset.
Question 2: What is the correct SELinux file context type for content served by Apache (httpd)?
- httpd_exec_t
- httpd_sys_content_t (Correct answer)
- httpd_config_t
- httpd_var_run_t
Correct answer: httpd_sys_content_t
Files intended to be served by Apache must have the 'httpd_sys_content_t' SELinux type.
Question 3: Which firewall-cmd option makes a rule survive a system reboot?
- --save
- --permanent (Correct answer)
- --reload
- --persist
Correct answer: --permanent
The '--permanent' flag writes the rule to the persistent firewalld configuration that survives reboots.
Question 4: Which command sets the default ACL on a directory so that new files inherit specific permissions?
- setfacl -m d:u:alice:rw /dir (Correct answer)
- chmod g+s /dir
- setfacl -x u:alice /dir
- chacl default /dir
Correct answer: setfacl -m d:u:alice:rw /dir
The 'd:' prefix in setfacl creates a default ACL that new files and subdirectories inherit.
Question 5: A logical volume needs to grow from 2G to 5G. Which sequence of commands is correct?
- lvextend -L 5G /dev/vg0/lv0, then resize2fs /dev/vg0/lv0 (Correct answer)
- vgextend, then lvresize
- pvcreate, then lvcreate
- lvreduce -L 5G /dev/vg0/lv0, then e2fsck
Correct answer: lvextend -L 5G /dev/vg0/lv0, then resize2fs /dev/vg0/lv0
lvextend resizes the logical volume, then resize2fs (or xfs_growfs for XFS) expands the filesystem to fill it.
Question 6: How do you configure a system to use 192.168.1.1 as the DNS server persistently using NetworkManager?
- Edit /etc/resolv.conf directly
- nmcli con mod <conn> ipv4.dns 192.168.1.1, then restart connection (Correct answer)
- Edit /etc/hosts
- Run dns-set 192.168.1.1
Correct answer: nmcli con mod <conn> ipv4.dns 192.168.1.1, then restart connection
nmcli con mod sets the DNS in NetworkManager's connection profile, which persists and rebuilds /etc/resolv.conf on reconnect.
Question 7: Which command enables a systemd service to start automatically at boot AND starts it immediately?
- systemctl start svc
- systemctl enable --now svc (Correct answer)
- systemctl activate svc
- systemctl boot-enable svc
Correct answer: systemctl enable --now svc
'systemctl enable --now' creates the symlink for boot persistence and starts the service in one command.
Which command resets a forgotten root password in RHEL 8 by interrupting the boot process and appending 'rd.break' to the kernel line?