CompTIACompTIA
XK0-005 · Question #231
XK0-005 Question #231: Real Exam Question with Answer & Explanation
The correct answer is C: ls -z. Even with full file permissions, SELinux can deny access; therefore, viewing the file's SELinux security context is necessary to diagnose access_denied errors.
Security
Question
A user receives an access_denied error when trying to modify a file, even though the file permissions are set to 777. Which of the following commands should be used to view additional file permissions?
Options
- Agetsebool
- Bgetenforce
- Cls -z
- Dps -z
Explanation
Even with full file permissions, SELinux can deny access; therefore, viewing the file's SELinux security context is necessary to diagnose access_denied errors.
Common mistakes.
- A.
getseboolis used to display the state of SELinux booleans, which are high-level policy controls, but it does not provide specific file context information. - B.
getenforceshows the current enforcement mode of SELinux (e.g., enforcing, permissive, disabled), indicating if SELinux is active, but not the specific reason for a file access denial. - D.
ps -Zdisplays the SELinux security context associated with running processes, not files, and is not relevant for diagnosing file access issues directly.
Concept tested. SELinux context and file permissions
Topics
#SELinux#File Permissions#Security Context#Troubleshooting
Community Discussion
No community discussion yet for this question.