An administrator has discovered that a newly deployed web application cannot write to the /var/www/html/reports directory on a SELinux-enabled system, despite the directory having write permissions set for the proper user and group. Which of the following commands should the administrator use to diagnose the issue related to SELinux context permissions?
The correct answer is ls -Z /var/www/html/reports. The -Z option displays the SELinux context for files, which includes user, role, type, and level information. This information is crucial in diagnosing why the web application cannot write to the directory despite seemingly appropriate Unix file permissions. If the SELinux context is incorrect, even with the right Unix permissions, access will be denied based on SELinux policy rules.
The other options are incorrect because getsebool -a lists all of the SELinux boolean values, which are not specific to file contexts. ps auxZ shows the SELinux context of running processes, not files. sestatus provides an overview of the current SELinux operational state; it does not provide information on specific file contexts.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.