{
    "mode": "man",
    "parameter": "passwd",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/passwd/5/json",
    "generated": "2026-06-02T16:00:27Z",
    "sections": {
        "NAME": {
            "content": "passwd - the password file\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "/etc/passwd contains one line for each user account, with seven fields delimited by colons\n(“:”). These fields are:\n\n•   login name\n\n•   optional encrypted password\n\n•   numerical user ID\n\n•   numerical group ID\n\n•   user name or comment field\n\n•   user home directory\n\n•   optional user command interpreter\n\nIf the password field is a lower-case “x”, then the encrypted password is actually stored in\nthe shadow(5) file instead; there must be a corresponding line in the /etc/shadow file, or\nelse the user account is invalid.\n\nThe encrypted password field may be empty, in which case no password is required to\nauthenticate as the specified login name. However, some applications which read the\n/etc/passwd file may decide not to permit any access at all if the password field is blank.\n\nA password field which starts with an exclamation mark means that the password is locked. The\nremaining characters on the line represent the password field before the password was locked.\n\nRefer to crypt(3) for details on how this string is interpreted.\n\nIf the password field contains some string that is not a valid result of crypt(3), for\ninstance ! or *, the user will not be able to use a unix password to log in (but the user may\nlog in the system by other means).\n\nThe comment field is used by various system utilities, such as finger(1).\n\nThe home directory field provides the name of the initial working directory. The login\nprogram uses this information to set the value of the $HOME environmental variable.\n\nThe command interpreter field provides the name of the user's command language interpreter,\nor the name of the initial program to execute. The login program uses this information to set\nthe value of the $SHELL environmental variable. If this field is empty, it defaults to the\nvalue /bin/sh.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/passwd\nUser account information.\n\n/etc/shadow\noptional encrypted password file\n\n/etc/passwd-\nBackup file for /etc/passwd.\n\nNote that this file is used by the tools of the shadow toolsuite, but not by all user and\npassword management tools.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "crypt(3), getent(1), getpwnam(3), login(1), passwd(1), pwck(8), pwconv(8), pwunconv(8),\nshadow(5), su(1), sulogin(8).\n\n\n\nshadow-utils 4.8.1                           02/06/2024                                    PASSWD(5)",
            "subsections": []
        }
    },
    "summary": "passwd - the password file",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "crypt",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/crypt/3/json"
        },
        {
            "name": "getent",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/getent/1/json"
        },
        {
            "name": "getpwnam",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/getpwnam/3/json"
        },
        {
            "name": "login",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/login/1/json"
        },
        {
            "name": "pwck",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/pwck/8/json"
        },
        {
            "name": "pwconv",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/pwconv/8/json"
        },
        {
            "name": "pwunconv",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/pwunconv/8/json"
        },
        {
            "name": "shadow",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/shadow/5/json"
        },
        {
            "name": "su",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/su/1/json"
        },
        {
            "name": "sulogin",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/sulogin/8/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Change a user's password.",
        "examples": [
            {
                "description": "Change the password of the current user interactively",
                "command": "passwd"
            },
            {
                "description": "Change the password of a specific user",
                "command": "sudo passwd {{username}}"
            },
            {
                "description": "Get the current status of the user",
                "command": "passwd {{-S|--status}}"
            },
            {
                "description": "Make the password of the account blank (it will set the named account passwordless)",
                "command": "passwd {{-d|--delete}}"
            },
            {
                "description": "Set password programmatically (ideal for install scripts)",
                "command": "yes {{password}} | passwd"
            }
        ]
    }
}