A developer account named deploy can no longer log in to the company's Git server over SSH. The administrator finds the following line in /var/log/secure:
pam_unix(sshd:account): account deploy has expired (account expired)
Company policy states that the account must stay active until 15 August 2025. While signed in as root on the server, which single command will restore the user's access immediately and ensure the account is disabled automatically after that date?
The chage utility is designed to modify password-aging and account-expiration attributes that are stored in /etc/shadow. Using -E YYYY-MM-DD sets (or resets) the date on which the account becomes inaccessible, so chage -E 2025-08-15 deploy moves the expiration date to 15 August 2025 and clears the "account expired" condition at the same time.
passwd -l deploy and usermod -L (not listed here) lock the password by inserting an exclamation mark in the hash; they do not affect the account-expiration date and would further restrict access instead of restoring it. useradd -e 2025-08-15 deploy attempts to create a new user or change the system defaults, not the existing deploy account, so it fails to solve the problem. chage -d 0 deploy forces an immediate password change by setting the last-change field to the Unix epoch; it does not adjust the account-expiration date and therefore would still leave the account in an expired state. Only the chage -E command meets the requirement to reinstate access now and disable it after the specified date.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the `chage` command do?
Open an interactive chat with Bash
How does `passwd -l` differ from `chage -E`?
Open an interactive chat with Bash
What is the difference between `chage -E` and `useradd -e`?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Troubleshooting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access