EX200 Manage users and groups Practice Question
A company needs to create a user account for a temporary contractor who will work for exactly 90 days. The account must be automatically disabled after 90 days. Which command should the administrator use?
⚠ Common exam trap
Many candidates confuse the `-e` (account expiration date) option with a number of days, when it actually requires a specific date in YYYY-MM-DD format, and confusing `-f` (inactive days after password expiry) with account expiration.
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
✓
useradd -e $(date -d '+90 days' +%Y-%m-%d) contractor
The `-e` (expiration date) option sets the date on which the user account will be disabled. Using `$(date -d '+90 days' +%Y-%m-%d)` dynamically calculates the exact date 90 days from today in YYYY-MM-DD format, which meets the requirement for automatic disable after exactly 90 days.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
useradd -f 90 contractor
Why it's wrong here
Incorrect. The -f option sets the number of days after a password expires until the account is permanently disabled, not an account expiration date. Additionally, it requires a prior password expiration to take effect, so it does not disable the account after exactly 90 days from creation.
- ✓
useradd -e $(date -d '+90 days' +%Y-%m-%d) contractor
Why this is correct
Correct. The -e option specifies an account expiration date in YYYY-MM-DD format. Using $(date -d '+90 days' +%Y-%m-%d) dynamically calculates the date 90 days from today, ensuring the account is disabled after exactly 90 days.
- ✗
useradd -e 90 contractor
Why it's wrong here
Incorrect. The -e option requires a specific date in YYYY-MM-DD format, not a number of days. Passing '90' would be interpreted as an invalid date or a date like January 1, 1990, not 90 days from now.
- ✗
useradd -f 90 -e 0 contractor
Why it's wrong here
Incorrect. The -f 90 sets the inactivity period after password expiry, but -e 0 sets the account expiration to the epoch (January 1, 1970), which disables the account immediately or in the past, not after 90 days.
Go deeper
Related to this question
About these practice questions
This EX200 question is part of Courseiva's 127-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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This EX200 practice question is part of Courseiva's free Red Hat 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 EX200 exam.