Perform a ticket-style password reset for a user account and
enforce a concrete aging policy using passwd, then
provide proof of the final state using status output suitable
for documentation or a change record.
“Satoshi forgot their password. Force a reset and enforce policy.” You must reset the password, force a change at next login, set aging parameters, and verify status so the ticket has proof of compliance.
Do evidence-first admin work. Capture the baseline state, apply changes explicitly, then prove the end state using the same tool the system uses for status.
passwd -S.
passwd.
passwd -S.
passwd -S provides ticket-friendly evidence:
set date and aging fields.
passwd -S satoshi
This is your before-state proof. It documents whether a password is set and shows aging fields in one line, which is useful for tickets and change records.
# Example output:
satoshi P 05/20/2025 0 99999 7 -1 (Password set, SHA512 crypt.)
passwd satoshi
This performs the administrative reset. In real ops, you would set a temporary password via an approved method and then force a change at next login.
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
passwd -e -n 7 -x 90 -w 14 -i 30 satoshi
This enforces policy immediately. It forces an update at next login and applies minimum, maximum, warning, and inactive lock parameters exactly as specified in the ticket.
passwd: password expiry information changed.
passwd -S satoshi
This is your after-state proof for the ticket. The fields should reflect the new minimum/maximum/warn/inactive values.
# Example output:
satoshi P 05/20/2025 7 90 14 30 (Password set, SHA512 crypt.)
You are not root or do not have sufficient privileges. Perform the workflow as root or via approved privilege escalation.
Confirm you targeted the correct account name and re-check
status using passwd -S. If policy is managed by
centralized tooling, local changes may be overridden.
Minimum days can block immediate changes after a reset. If your policy requires “change at next login,” ensure the minimum value is compatible with that operational requirement.
Output formatting varies by distro and PAM tooling. Use the numeric fields as the primary evidence and keep your policy values explicit in the ticket.
This lab applies real changes to the user’s password and aging policy. If you are using a training account, confirm you have a known password state before ending the session.
passwd -S satoshi
passwd -S shows the enforced values (min 7, max
90, warn 14, inactive 30) and the account is in a known state.
passwd -S <user>
: Show password status and aging fields for a user.
passwd <user>
: Set or reset a user password (interactive).
passwd -e <user>
: Expire the password to force a change at next login.
passwd -n <days> <user>
: Set minimum days between password changes.
passwd -x <days> <user>
: Set maximum days before password expiration.
passwd -w <days> <user>
: Set warning days before password expiration.
passwd -i <days> <user>
: Set inactive lock days after password expiration.