Linux "pwck" Command Line Options and Examples
verify integrity of password files
The pwck command verifies the integrity of the users and authentication information. It checks that all entries in /etc/passwd and /etc/shadow have the proper format and contain valid data. The user is prompted to delete entries that are improperly formatted or which have other uncorrectable errors.
pwck [options] [passwd [ shadow ]]
Command Line Options:
Display help message and exit.
pwck -h ...
Report errors only. The warnings which do not require any action from the user won't be displayed.
pwck -q ...
Execute the pwck command in read-only mode.
pwck -r ...
Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.
pwck -R ...
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 withthe passwd and shadow parameters.CONFIGURATIONThe following configuration variables in /etc/login.defs change the behavior of this tool:PASS_MAX_DAYS (number)The maximum number of days a password may be used. If the password is older than this, a password changewill be forced. If not specified, -1 will be assumed (which disables the restriction).PASS_MIN_DAYS (number)The minimum number of days allowed between password changes. Any password changes attempted sooner thanthis will be rejected. If not specified, -1 will be assumed (which disables the restriction).PASS_WARN_AGE (number)The number of days warning given before a password expires. A zero means warning is given only upon theday of expiration, a negative value means no warning is given. If not specified, no warning will beprovided.FILES/etc/groupGroup account information./etc/passwdUser account information./etc/shadowSecure user account information.EXIT VALUESThe pwck command exits with the following values:0success1invalid command syntax2one or more bad password entries3can't open password files4can't lock password files5can't update password files6can't sort password files
pwck -s ...