passwd Command Generator
Generate passwd commands to change passwords and manage password policy
Getting Started with passwd
## What is passwd?
`passwd` changes a user's login password, or manages password policy (lock/unlock, expiration, status). Regular users change their own password; root can manage any account.
## How to Use
1. **Pick an Action**: Choose a flag such as `-l` (lock), `-u` (unlock), `-S` (status), or leave blank to change the password. 2. **Set Expiration** (optional): Configure `-x` (max days), `-n` (min days), `-w` (warn days). 3. **Enter Username**: Provide the account name (omit for your own account). 4. **Copy & Run**: Copy the generated command into your terminal.
Common Options
### (no flag) Change password Interactively prompts for a new password for the given user.
### `-l` Lock Lock the account by prefixing the password hash with `!`. The user can no longer log in via password.
### `-u` Unlock Reverse `-l` — remove the lock marker and restore password login.
### `-d` Delete Delete the password entirely (sets an empty password). Use with caution.
### `-S` Status Print a short status line: username, `P` (usable) / `L` (locked) / `NP` (no password), and last change date.
### `-e` Expire Force the password to expire immediately so the user must set a new one at next login.
### `-x` Max days Maximum password age before it must be changed.
### `-n` Min days Minimum days between password changes.
### `-w` Warn days Days of warning before password expiry.
▶How do I force a user to reset their password at next login?
▶How do I temporarily disable a login?
▶How do I check an account's password status?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee