The passwd command allows us to change or to assign a password of authentication of an user currently in the system.
When the user doesn’t have particular privileges, he is only able to change is password, while the root user has the possibility to change also other users’ passwords.
The command name stands for password.


The default passwd command syntax is:
passwd [flags]  [user]
Where [flags] are the passwd flags, read below for more info, the parameter [user] can only be specified by the root user. If no user is provided, passwd proceed to set the password of the user who uses this command. You will first be asked to enter the current user password.


Here are some of the most common passwd flags:
  • -d: Delete the user password
  • -h: Get information about how to use this command
  • -l: Lock the password
  • -u: Unlock the password
  • -S: See the account status information