After setting a temporary password for alice by hand, you want the system to force her to choose her own at her next login, without locking or expiring the account. Which command does that, and what does it write into /etc/shadow?
LPIC-1 Exam 102-500, objective 110. Security hard
Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.
Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.
How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.
The options
Correct chage -d 0 alice
Correct. -d sets the date of the last password change, field 3 of /etc/shadow, counted in days since 1 January 1970. The value 0 is treated specially: the password is considered to need changing, so login succeeds but immediately demands a new password.
Not correct chage -E 0 alice
Wrong. -E writes field 8, the account expiry date. Day 0 is 1 January 1970, which is long past, so the account is disabled and alice cannot log in at all.
Not correct chage -W 0 alice
Wrong. -W writes field 6, the number of warning days before password expiry. Setting it to zero only removes the advance warning; nothing about the current password changes.
Not correct chage -I 0 alice
Wrong. -I writes field 7, the inactivity period after password expiry. A value of zero means the account is disabled as soon as the password expires, which is a harsher rule, not a forced change.
Why
Field 3 of /etc/shadow is the day number on which the password was last changed, so a large value means recent. Zero is reserved to mean the password is stale and must be replaced at the next login, which is why chage -d 0 is the standard way to hand over a temporary password. Compare it with field 8, the account expiry date, where zero means a date in 1970 and therefore a dead account.
Where this comes from
- Cited
- manual page shadow(5)
Practise this
Reading one question is not practice. The trainer will draw a short set from objective 110 and space the ones you get wrong.
More questions on this objective
- During an audit you must list every file under /usr that has the set-user-ID bit set, regardless of what its other permission bits are. Which command does that? machine-checked
- You locked the password of the account `intern` and confirmed that its hash in /etc/shadow now begins with an exclamation mark. The intern nevertheless still reaches a shell on the host over SSH, without being prompted for anything. What is going on, and what actually stops it? machine-checked
- You have just been added to a sudo rule on a host and want sudo itself to report which commands you are allowed to run there, without running any of them. Type the complete command. machine-checked
- A daemon started from your bash session keeps hitting a 'too many open files' error. Which command raises the limit on open file descriptors for the current shell and the processes it starts to 4096? machine-checked
- You are about to take a server down for maintenance and want ordinary users refused at login for the next hour, with an explanatory message, while root can still get in. On a system using PAM's pam_nologin, creating which file achieves this? machine-checked
- Which two commands report the users who are logged in right now, rather than a history of past logins? (Choose two.) machine-checked