Courseiva
SecurityhardMultiple ChoiceObjective-mapped

XK0-006 Security Practice Question

A Linux administrator needs to configure auditing to monitor changes to the /etc/passwd file. Which auditctl command should be used?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

auditctl -w /etc/passwd -p wa -k passwd_changes

The correct command is option B. It uses the -w watch syntax to monitor /etc/passwd for write (w) and attribute change (a) permissions, which is the standard and simplest method for auditing changes. Option D is a valid syscall-based alternative but is more complex and not the best answer for this question. Option A includes read permission, which is unnecessary. Option C monitors unlink and rename syscalls, not direct file modifications.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • auditctl -w /etc/passwd -p rwxa -k passwd_changes

    Why it's wrong here

    Incorrect because it includes r (read) and x (execute) permissions, which are unnecessary for monitoring changes to /etc/passwd. The typical use case is to monitor writes and attribute changes only.

  • auditctl -w /etc/passwd -p wa -k passwd_changes

    Why this is correct

    Correct. The -w flag watches a file, -p wa specifies permissions to monitor (write and attribute change), and -k adds a key for filtering. This is the standard auditctl command for file change monitoring.

  • auditctl -a exit,always -S unlink -S rename -F path=/etc/passwd

    Why it's wrong here

    Incorrect because it uses syscall monitoring for unlink and rename, which track file deletion and renaming, not modifications to the file's content or attributes.

  • auditctl -a always,exit -F path=/etc/passwd -F perm=wa -k passwd_changes

    Why it's wrong here

    Incorrect for this context. The -a always,exit syntax is used for syscall-based auditing, not direct file watching. Although it can be configured to monitor file permissions, it is more complex and not the intended command for simple file change monitoring.

About these practice questions

One of 979 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.