{
    "mode": "info",
    "parameter": "pwck",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/pwck/json",
    "generated": "2026-07-06T04:10:35Z",
    "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\ninformation. It checks that all entries in /etc/passwd and /etc/shadow\nhave the proper format and contain valid data. The user is prompted to\ndelete entries that are improperly formatted or which have other\nuncorrectable errors.\n\nChecks are made to verify that each entry has:\n\no   the correct number of fields\n\no   a unique and valid user name\n\no   a valid user and group identifier\n\no   a valid primary group\n\no   a valid home directory\n\no   a valid login shell\n\nshadow checks are enabled when a second file parameter is specified or\nwhen /etc/shadow exists on the system.\n\nThese checks are the following:\n\no   every passwd entry has a matching shadow entry, and every shadow\nentry has a matching passwd entry\n\no   passwords are specified in the shadowed file\n\no   shadow entries have the correct number of fields\n\no   shadow entries are unique in shadow\n\no   the last password changes are not in the future\n\nThe checks for correct number of fields and unique user name are fatal.\nIf the entry has the wrong number of fields, the user will be prompted\nto delete the entire line. If the user does not answer affirmatively,\nall further checks are bypassed. An entry with a duplicated user name\nis prompted for deletion, but the remaining checks will still be made.\nAll other errors are warning and the user is encouraged to run the\nusermod command to correct the error.\n\nThe commands which operate on the /etc/passwd file are not able to\nalter corrupted or duplicated entries.  pwck should be used in those\ncircumstances to remove the offending entry.\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\nfrom the user won't be displayed.\n",
                    "flag": "-q",
                    "long": "--quiet"
                },
                {
                    "name": "-r, --read-only",
                    "content": "Execute the pwck command in read-only mode.\n\n-R, --root CHROOTDIR\nApply changes in the CHROOTDIR directory and use the configuration\nfiles from the CHROOTDIR directory.\n",
                    "flag": "-r",
                    "long": "--read-only"
                },
                {
                    "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\nuser may select alternate files with the passwd and shadow parameters.\n",
                    "flag": "-s",
                    "long": "--sort"
                }
            ]
        },
        "CONFIGURATION": {
            "content": "The following configuration variables in /etc/login.defs change the\nbehavior of this tool:\n\nPASSMAXDAYS (number)\nThe maximum number of days a password may be used. If the password\nis older than this, a password change will be forced. If not\nspecified, -1 will be assumed (which disables the restriction).\n\nPASSMINDAYS (number)\nThe minimum number of days allowed between password changes. Any\npassword changes attempted sooner than this will be rejected. If\nnot specified, -1 will be assumed (which disables the restriction).\n\nPASSWARNAGE (number)\nThe number of days warning given before a password expires. A zero\nmeans warning is given only upon the day of expiration, a negative\nvalue means no warning is given. If not specified, no warning will\nbe provided.\n",
            "subsections": []
        },
        "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\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. -R, --root CHROOTDIR 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"
        }
    ]
}