{
    "mode": "man",
    "parameter": "pwck",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/pwck/8/json",
    "generated": "2026-06-02T16:23:00Z",
    "synopsis": "pwck [options] [passwd [ shadow ]]",
    "sections": {
        "NAME": {
            "content": "pwck - verify integrity of password files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pwck [options] [passwd [ shadow ]]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The pwck command verifies the integrity of the users and authentication information. It\nchecks that all entries in /etc/passwd and /etc/shadow have the proper format and contain\nvalid data. The user is prompted to delete entries that are improperly formatted or which\nhave other uncorrectable errors.\n\nChecks are made to verify that each entry has:\n\n•   the correct number of fields\n\n•   a unique and valid user name\n\n•   a valid user and group identifier\n\n•   a valid primary group\n\n•   a valid home directory\n\n•   a valid login shell\n\nshadow checks are enabled when a second file parameter is specified or when /etc/shadow\nexists on the system.\n\nThese checks are the following:\n\n•   every passwd entry has a matching shadow entry, and every shadow entry has a matching\npasswd entry\n\n•   passwords are specified in the shadowed file\n\n•   shadow entries have the correct number of fields\n\n•   shadow entries are unique in shadow\n\n•   the last password changes are not in the future\n\nThe checks for correct number of fields and unique user name are fatal. If the entry has the\nwrong number of fields, the user will be prompted to delete the entire line. If the user does\nnot answer affirmatively, all further checks are bypassed. An entry with a duplicated user\nname is prompted for deletion, but the remaining checks will still be made. All other errors\nare warning and the user is encouraged to run the usermod command to correct the error.\n\nThe commands which operate on the /etc/passwd file are not able to alter corrupted or\nduplicated entries.  pwck should be used in those circumstances to remove the offending\nentry.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The -r and -s options cannot be combined.\n\nThe options which apply to the pwck command are:\n",
            "subsections": [
                {
                    "name": "--badname",
                    "content": "Allow names that do not conform to standards.\n",
                    "long": "--badname"
                },
                {
                    "name": "-h --help",
                    "content": "Display help message and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-q --quiet",
                    "content": "Report errors only. The warnings which do not require any action from the user won't be\ndisplayed.\n",
                    "flag": "-q",
                    "long": "--quiet"
                },
                {
                    "name": "-r --read-only",
                    "content": "Execute the pwck command in read-only mode.\n",
                    "flag": "-r",
                    "long": "--read-only"
                },
                {
                    "name": "-R --root",
                    "content": "Apply changes in the CHROOTDIR directory and use the configuration files from the\nCHROOTDIR directory.\n",
                    "flag": "-R",
                    "long": "--root"
                },
                {
                    "name": "-s --sort",
                    "content": "Sort entries in /etc/passwd and /etc/shadow by UID.\n\nBy default, pwck operates on the files /etc/passwd and /etc/shadow. The user may select\nalternate files with the passwd and shadow parameters.\n",
                    "flag": "-s",
                    "long": "--sort"
                }
            ]
        },
        "CONFIGURATION": {
            "content": "The following configuration variables in /etc/login.defs change the behavior of this tool:\n",
            "subsections": [
                {
                    "name": "PASS___MAX___DAYS (number)",
                    "content": "The maximum number of days a password may be used. If the password is older than this, a\npassword change will be forced. If not specified, -1 will be assumed (which disables the\nrestriction).\n"
                },
                {
                    "name": "PASS___MIN___DAYS (number)",
                    "content": "The minimum number of days allowed between password changes. Any password changes\nattempted sooner than this will be rejected. If not specified, -1 will be assumed (which\ndisables the restriction).\n"
                },
                {
                    "name": "PASS___WARN___AGE (number)",
                    "content": "The number of days warning given before a password expires. A zero means warning is given\nonly upon the day of expiration, a negative value means no warning is given. If not\nspecified, no warning will be provided.\n"
                }
            ]
        },
        "FILES": {
            "content": "/etc/group\nGroup account information.\n\n/etc/passwd\nUser account information.\n\n/etc/shadow\nSecure user account information.\n",
            "subsections": []
        },
        "EXIT VALUES": {
            "content": "The pwck command exits with the following values:\n\n0\nsuccess\n\n1\ninvalid command syntax\n\n2\none or more bad password entries\n\n3\ncan't open password files\n\n4\ncan't lock password files\n\n5\ncan't update password files\n\n6\ncan't sort password files\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "group(5), grpck(8), passwd(5), shadow(5), usermod(8).\n\n\n\nshadow-utils 4.8.1                           02/06/2024                                      PWCK(8)",
            "subsections": []
        }
    },
    "summary": "pwck - verify integrity of password files",
    "flags": [
        {
            "flag": "",
            "long": "--badname",
            "arg": null,
            "description": "Allow names that do not conform to standards."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help message and exit."
        },
        {
            "flag": "-q",
            "long": "--quiet",
            "arg": null,
            "description": "Report errors only. The warnings which do not require any action from the user won't be displayed."
        },
        {
            "flag": "-r",
            "long": "--read-only",
            "arg": null,
            "description": "Execute the pwck command in read-only mode."
        },
        {
            "flag": "-R",
            "long": "--root",
            "arg": null,
            "description": "Apply changes in the CHROOTDIR directory and use the configuration files from the CHROOTDIR directory."
        },
        {
            "flag": "-s",
            "long": "--sort",
            "arg": null,
            "description": "Sort entries in /etc/passwd and /etc/shadow by UID. By default, pwck operates on the files /etc/passwd and /etc/shadow. The user may select alternate files with the passwd and shadow parameters."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "group",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/group/5/json"
        },
        {
            "name": "grpck",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/grpck/8/json"
        },
        {
            "name": "passwd",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/passwd/5/json"
        },
        {
            "name": "shadow",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/shadow/5/json"
        },
        {
            "name": "usermod",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/usermod/8/json"
        }
    ]
}