Courseiva
hardMultiple ChoiceObjective-mapped

XK0-006 Practice Question: A security policy requires that user passwords…

Exhibit

Refer to the exhibit.

$ cat /etc/shadow
root:$6$xyz...:18000:0:99999:7:::
$ sudo passwd -S root
root P 08/15/2024 0 99999 7 -1
$ sudo chage -l root
Last password change                                    : Aug 15, 2024
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7

A security policy requires that user passwords must expire after 90 days. The output in the exhibit shows the current configuration for the root user. Which command should the administrator run to enforce the policy for root?

⚠ Common exam trap

Test-takers frequently confuse the `chage -M` (maximum password age) with `chage -E` (account expiration) or `usermod -e` (account expiration), leading them to select options that set account expiry instead of password expiry, which does not enforce the 90-day password change requirement.

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

sudo chage -M 90 root

The `chage -M 90 root` command sets the maximum number of days a password is valid for the root user to 90 days, which directly enforces the password expiration policy. The `-M` option modifies the `max_days` field in `/etc/shadow`, causing the password to expire after the specified period. This is the correct method to apply aging rules to the root account.

Answer analysis

Option-by-option breakdown

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

  • sudo passwd -x 90 root

    Why it's wrong here

    Also sets maximum password age but chage is preferred; however, passwd -x works, but chage is more common in exam contexts.

  • sudo chage -M 90 root

    Why this is correct

    Sets the maximum number of days a password remains valid.

  • sudo chage -E 90 root

    Why it's wrong here

    Sets the account expiration date, not password expiration.

  • sudo usermod -e 90 root

    Why it's wrong here

    Sets the account expiry date, not password aging.

About these practice questions

This XK0-006 question is part of Courseiva's 979-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 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.