nerdexam
CompTIA

XK0-005 · Question #13

An operator finds a user is having issues with opening certain files. Which of the following commands would allow the security administrator to list and check the SELinux context? ls -D A.

The correct answer is C. ls -Z. The command 'ls -Z' displays the SELinux security context (label) for files and directories. The SELinux context includes the user, role, type, and level fields (e.g., 'system_u:object_r:httpd_sys_content_t:s0'). When a user cannot open files, checking these labels helps…

Security

Question

An operator finds a user is having issues with opening certain files. Which of the following commands would allow the security administrator to list and check the SELinux context? ls -D A.

Options

  • Bls -a
  • Cls -Z

How the community answered

(30 responses)
  • B
    10% (3)
  • C
    90% (27)

Explanation

The command 'ls -Z' displays the SELinux security context (label) for files and directories. The SELinux context includes the user, role, type, and level fields (e.g., 'system_u:object_r:httpd_sys_content_t:s0'). When a user cannot open files, checking these labels helps identify whether SELinux policy is denying access. Option A ('ls -D') is not a valid or standard 'ls' flag and would produce an error. Option B ('ls -a') shows hidden files (those beginning with a dot) - it has nothing to do with SELinux contexts. The '-Z' flag is the correct and standard option for SELinux label inspection.

Topics

#SELinux#File Context#ls command#Linux Security

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice