PWCK(8)
๐ PWCK ๐
okay bestie, so this one's pwck from section 8 of the manual โ it lives in the System Management Commands crowd, and it is literally the vibe-checker for your password files. no cap.
โจ NAME โจ
pwck โ verify the integrity of password files ๐ซถ
โจ SYNOPSIS โจ
pwck [options] [PASSWORDFILE [ SHADOWFILE ]]
โจ DESCRIPTION โจ
so the pwck command is out here checking the integrity of your users and your authentication info. it goes through every entry in /etc/passwd and /etc/shadow and makes sure they have the proper format and hold valid data. and if something is improperly formatted or has some other uncorrectable error? it asks the user โ that's you โ to delete that entry. not me being the bouncer at the club ๐
here's what it checks for, entry by entry:
- the correct number of fields
- a unique and valid user name
- a valid user and group identifier
- a valid primary group
- a valid home directory
- a valid login shell
the shadowed password info checks turn on when you pass the second file parameter, SHADOWFILE, or when /etc/shadow exists on the system. either/or, queen.
and these checks are the following:
- every passwd entry has a matching shadow entry, and every shadow entry has a matching passwd entry
- passwords are specified in the shadowed file
- shadow entries have the correct number of fields
- shadow entries are unique in shadow
- the last password changes are not in the future
now listen, because this part matters: the checks for correct number of fields and unique user name are fatal. if an entry has the wrong number of fields, the user gets prompted to delete the entire line. and if the user doesn't answer affirmatively, all further checks are bypassed. gone. skipped. an entry with a duplicated user name gets prompted for deletion too, but the remaining checks will still be made โ so that one's a soft launch, not a full cancel. every other error is just a warning, and the user is encouraged to run the usermod command to fix it.
and here's the tea: the commands that operate on the /etc/passwd file are not able to alter corrupted or duplicated entries. so in those circumstances, pwck should be used to remove the offending entry. it's giving main character energy, fr fr ๐
โจ OPTIONS โจ
okay first thing: the -r and -s options cannot be combined. pick a lane bestie, you can't have both ๐
the options which apply to the pwck command are:
--badnameโ allow names that do not conform to standards. living on the edge, i respect it โจ-h,--helpโ display help message and exit. the classic "what does this do again" move ๐-q,--quietโ report errors only. the warnings which do not require any action from the user won't be displayed. silence is golden ๐-r,--read-onlyโ execute thepwckcommand in read-only mode. look but don't touch ๐ซถ-R,--rootCHROOT_DIR โ apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. only absolute paths are supported. **no SELINUX support. ๐ซ-s,--sortโ sort entries in/etc/passwdand/etc/shadowby UID. so satisfying, honestly ๐ง
by default, pwck operates on the files /etc/passwd and /etc/shadow. the user may select alternate files with the passwd and shadow parameters. customize your own adventure ๐
โจ CONFIGURATION โจ
these configuration variables in /etc/login.defs change the behavior of this tool:
NONEXISTENT(string) โ if a system account intentionally does not have a home directory that exists, this string can be provided in the/etc/passwdentry for the account to indicate this. the result is thatpwckwill not emit a spurious warning for this account. no false alarms, no drama ๐ธPASS_MAX_DAYS(number) โ the maximum number of days a password may be used. if the password is older than this, a password change will be forced. if not specified,-1will 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 the day of expiration, a value of-1means no warning is given. if not specified, no warning will be provided.
โจ FILES โจ
/etc/groupโ group account information./etc/passwdโ user account information./etc/shadowโ secure user account information. ๐
โจ EXIT VALUES โจ
the pwck command exits with the following values:
0โ success ๐1โ invalid command syntax2โ one or more bad password entries3โ can't open password files4โ can't lock password files5โ can't update password files6โ can't sort password files
โจ SEE ALSO โจ
group(5), grpck(8), passwd(5), shadow(5), usermod(8).
and that's the whole page bestie, you ate that ๐ โจ this one's brought to you by shadow-utils 4.20.0, dated 07/30/2026 โ go forth and verify those password files, ily ๐ซถ๐
๐ฆ where this page comes from
- arch rolling: shadow 4.20.0.arch1-1 ยท 0BSD AND BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms