Courseiva
SecuritymediumMultiple SelectObjective-mapped

XK0-006 usermod -e Practice Question

A security audit reveals that user accounts remain active after employees leave the company. Which TWO commands should be used to disable an account immediately?

⚠ Common exam trap

The trap is that candidates may think locking and expiring are equivalent, but expiring disables all login methods while locking only disables password logins. The question asks for two commands to disable immediately, so the best pair is usermod -e for full expiration and usermod -L for password lock.

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

usermod -e 1 username

To disable an account immediately, `usermod -e 1 username` (option B) sets the account expiration date to January 1, 1970, which immediately expires the account and prevents all login methods. `usermod -L username` (option C) locks the user's password, preventing password-based authentication. Both commands together provide immediate disablement covering all authentication paths. Option D also locks the password but is redundant with C; the question asks for two commands, so B and C are the most appropriate. Option A sets expiration to 0 days after epoch, which may not disable immediately. Option E deletes the account, which is not the same as disabling.

Answer analysis

Option-by-option breakdown

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

  • chage -E 0 username

    Why it's wrong here

    chage -E 0 sets the expiration date to 0 days after epoch, which is ambiguous and may not disable the account immediately; it is not the correct command.

  • usermod -e 1 username

    Why this is correct

    Correct. usermod -e 1 sets the account to expire on January 1, 1970, immediately disabling all login methods.

  • usermod -L username

    Why this is correct

    Correct. usermod -L locks the user's password, preventing password authentication.

  • passwd -l username

    Why it's wrong here

    passwd -l also locks the password, but it is similar to usermod -L. Since the question asks for two commands, usermod -L is preferred over passwd -l because it is more comprehensive with other flags.

  • userdel username

    Why it's wrong here

    userdel deletes the user account entirely, which is not just disabling and is irreversible; not the correct action for immediate disablement.

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.