Courseiva
Security →easyMultiple Choice

XK0-006 Security Practice Question

A Linux administrator needs to ensure that all user passwords meet a minimum length of 12 characters and include at least one uppercase letter, one lowercase letter, one digit, and one special character. Which file should be edited to enforce these password complexity requirements?

⚠ Common exam trap

The trap here is assuming that /etc/login.defs handles all password policies, but it only covers aging and minimum length, not character complexity.

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

✓

/etc/security/pwquality.conf

Password complexity requirements are enforced by the pam_pwquality module, which reads its configuration from /etc/security/pwquality.conf. This file allows setting parameters like minlen, ucredit, lcredit, dcredit, and ocredit to require specific character types and lengths. The other files serve different purposes and cannot enforce these rules.

Answer analysis

Option-by-option breakdown

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

  • ✓

    /etc/security/pwquality.conf

    Why this is correct

    The /etc/security/pwquality.conf file is used by the pam_pwquality module to enforce password complexity rules such as minimum length (minlen), required character classes (ucredit, lcredit, dcredit, ocredit), and other checks. Editing this file allows the administrator to set these requirements system-wide for all users, ensuring compliance with the security policy.

  • ✗

    /etc/pam.d/system-auth

    Why it's wrong here

    /etc/pam.d/system-auth is a PAM configuration file that controls authentication modules. While it may include the pam_pwquality module, editing it directly to set complexity parameters is not the standard method. The pam_pwquality module reads its settings from /etc/security/pwquality.conf, so changes should be made there. Modifying system-auth could affect authentication flow and is not the recommended place for password policy settings.

  • ✗

    /etc/login.defs

    Why it's wrong here

    /etc/login.defs contains configuration for login behavior, such as password aging (PASS_MAX_DAYS), UID/GID ranges, and umask, but it does not enforce password complexity rules like character classes. While it can set a minimum password length via PASS_MIN_LEN, it cannot require uppercase, lowercase, digits, or special characters. Therefore, it is insufficient for the stated requirements.

  • ✗

    /etc/shadow

    Why it's wrong here

    /etc/shadow stores encrypted user passwords and password aging information, but it does not contain policy settings for complexity. Editing this file would not enforce any rules; it only holds per-user data. Password complexity must be enforced through PAM modules that check passwords at change time, configured via pwquality.conf or similar.

About these practice questions

This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

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.