Question 1130
A RHEL 10 web-content directory /srv/web14 is subject to SELinux policy. The administrator must apply a previously defined default file context recursively. A review considers `semanage fcontext -a -t httpd_sys_content_t "/srv/web14(/.*)?"` as an alternative. Its relevant behavior is: semanage fcontext records the default SELinux labeling rule for files under this path. That is a different result from the requested operation. Which listed command satisfies the original requirement without substituting this other behavior?
Explanation
Correct Answer
restorecon applies the policy-defined default labels to existing files and directories It performs the requested label-management step. This matches the stated requirement to apply a previously defined default file context recursively. By contrast, the plausible alternative `ls -Z /srv/web14` has the effect: ls -Z displays the SELinux security context of listed filesystem objects It reads or applies a different part of SELinux context management; that operation would not achieve the requested result.
Incorrect Answers
semanage fcontext records the default SELinux labeling rule for files under this path It reads or applies a different part of SELinux context management. The stated task is to apply a previously defined default file context recursively. Instead, `restorecon -Rv /srv/web14` is the relevant alternative because restorecon applies the policy-defined default labels to existing files and directories It performs the requested label-management step.
ls -Z displays the SELinux security context of listed filesystem objects It reads or applies a different part of SELinux context management. The stated task is to apply a previously defined default file context recursively. Instead, `restorecon -Rv /srv/web14` is the relevant alternative because restorecon applies the policy-defined default labels to existing files and directories It performs the requested label-management step.
matchpathcon resolves the file-context policy entry for the named path It reads or applies a different part of SELinux context management. The stated task is to apply a previously defined default file context recursively. Instead, `restorecon -Rv /srv/web14` is the relevant alternative because restorecon applies the policy-defined default labels to existing files and directories It performs the requested label-management step.






Red Hat Certified System Administrator (RHCSA) (EX200) Practice Tests