When to use passwd
Use passwd to change passwords through the system's authentication policy. Password prompts are interactive and should never be replaced by placing a real password directly in a command line or saved snippet.
Syntax
passwd [OPTIONS] [USER]Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.
Common options and arguments
Usage examples
Change your password
passwdThe current account changes its password after the required identity checks.
Show password status
passwd -SAccount password status is displayed rather than the password itself.
Change the selected user's password
sudo passwd deployAn authorised administrator changes the named account's password; coordinate this to avoid locking out its owner.
Notes and limitations
- The new password is entered interactively; don't pass it on the command line.
- Password locking does not necessarily prevent login using the SSH key or other authentication methods.
Common questions and troubleshooting
Why are no characters visible while typing?
Password prompts normally suppress echo, including placeholder stars. Enter the password carefully and follow the confirmation prompt.
Why is a chosen password rejected?
Local or centrally managed policy may enforce complexity, age or history requirements. Follow that policy instead of disabling it to complete a test.
Further help
Options vary by version and distribution. Check the installed documentation with this command: man passwd.