passwd

Change or set a user account password.

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

passwd updates /etc/shadow. Root can change any user's password. -l locks an account, -u unlocks, -e forces a password change on next login.

Common flags
FlagMeaning
-l --lockLock the account (prefix ! in shadow)
-u --unlockUnlock a locked account
-e --expireForce password change on next login
Examples
passwd aliceInteractively change alice's password (as root) · explain & risk-check →
passwd -e deployForce deploy user to set a new password on next login · explain & risk-check →
passwd -l tempuserLock tempuser account during an investigation · explain & risk-check →
Pro tip

Use `chage -l username` to view password expiry info including last changed date and warning period.

Related
useradd usermod chage sudo
Open the full explainer →More in Users, Permissions & Security

Reference text is hand-written and may be incomplete — check man passwd for your version. Test destructive commands on a non-production system first.