# passwd(5) - man - phpman

> **TLDR:** Change a user's password.
>
- Change the password of the current user interactively:
  `passwd`
- Change the password of a specific user:
  `sudo passwd {{username}}`
- Get the current status of the user:
  `passwd {{-S|--status}}`
- Make the password of the account blank (it will set the named account passwordless):
  `passwd {{-d|--delete}}`
- Set password programmatically (ideal for install scripts):
  `yes {{password}} | passwd`

*Source: tldr-pages*

---

[PASSWD(5)](https://www.chedong.com/phpMan.php/man/PASSWD/5/markdown)                           File Formats and Conversions                           [PASSWD(5)](https://www.chedong.com/phpMan.php/man/PASSWD/5/markdown)



## NAME
       passwd - the password file

## DESCRIPTION
       /etc/passwd contains one line for each user account, with seven fields delimited by colons
       (“:”). These fields are:

       •   login name

       •   optional encrypted password

       •   numerical user ID

       •   numerical group ID

       •   user name or comment field

       •   user home directory

       •   optional user command interpreter

       If the _password_ field is a lower-case “x”, then the encrypted password is actually stored in
       the [**shadow**(5)](https://www.chedong.com/phpMan.php/man/shadow/5/markdown) file instead; there _must_ be a corresponding line in the /etc/shadow file, or
       else the user account is invalid.

       The encrypted _password_ field may be empty, in which case no password is required to
       authenticate as the specified login name. However, some applications which read the
       /etc/passwd file may decide not to permit _any_ access at all if the _password_ field is blank.

       A _password_ field which starts with an exclamation mark means that the password is locked. The
       remaining characters on the line represent the _password_ field before the password was locked.

       Refer to [**crypt**(3)](https://www.chedong.com/phpMan.php/man/crypt/3/markdown) for details on how this string is interpreted.

       If the password field contains some string that is not a valid result of [**crypt**(3)](https://www.chedong.com/phpMan.php/man/crypt/3/markdown), for
       instance ! or *, the user will not be able to use a unix password to log in (but the user may
       log in the system by other means).

       The comment field is used by various system utilities, such as [**finger**(1)](https://www.chedong.com/phpMan.php/man/finger/1/markdown).

       The home directory field provides the name of the initial working directory. The **login**
       program uses this information to set the value of the **$HOME** environmental variable.

       The command interpreter field provides the name of the user's command language interpreter,
       or the name of the initial program to execute. The **login** program uses this information to set
       the value of the **$SHELL** environmental variable. If this field is empty, it defaults to the
       value /bin/sh.

## FILES
       /etc/passwd
           User account information.

       /etc/shadow
           optional encrypted password file

       /etc/passwd-
           Backup file for /etc/passwd.

           Note that this file is used by the tools of the shadow toolsuite, but not by all user and
           password management tools.

## SEE ALSO
       [**crypt**(3)](https://www.chedong.com/phpMan.php/man/crypt/3/markdown), [**getent**(1)](https://www.chedong.com/phpMan.php/man/getent/1/markdown), [**getpwnam**(3)](https://www.chedong.com/phpMan.php/man/getpwnam/3/markdown), [**login**(1)](https://www.chedong.com/phpMan.php/man/login/1/markdown), [**passwd**(1)](https://www.chedong.com/phpMan.php/man/passwd/1/markdown), [**pwck**(8)](https://www.chedong.com/phpMan.php/man/pwck/8/markdown), [**pwconv**(8)](https://www.chedong.com/phpMan.php/man/pwconv/8/markdown), [**pwunconv**(8)](https://www.chedong.com/phpMan.php/man/pwunconv/8/markdown),
       [**shadow**(5)](https://www.chedong.com/phpMan.php/man/shadow/5/markdown), [**su**(1)](https://www.chedong.com/phpMan.php/man/su/1/markdown), [**sulogin**(8)](https://www.chedong.com/phpMan.php/man/sulogin/8/markdown).



shadow-utils 4.8.1                           02/06/2024                                    [PASSWD(5)](https://www.chedong.com/phpMan.php/man/PASSWD/5/markdown)
