1PWCK(8)                   System Management Commands                   PWCK(8)
2
3
4

NAME

6       pwck - verify the integrity of password files
7

SYNOPSIS

9       pwck [options] [PASSWORDFILE [ SHADOWFILE ]]
10

DESCRIPTION

12       The pwck command verifies the integrity of the users and authentication
13       information. It checks that all entries in /etc/passwd and /etc/shadow
14       have the proper format and contain valid data. The user is prompted to
15       delete entries that are improperly formatted or which have other
16       uncorrectable errors.
17
18       Checks are made to verify that each entry has:
19
20       •   the correct number of fields
21
22       •   a unique and valid user name
23
24       •   a valid user and group identifier
25
26       •   a valid primary group
27
28       •   a valid home directory
29
30       •   a valid login shell
31
32       Checks for shadowed password information are enabled when the second
33       file parameter SHADOWFILE is specified or when /etc/shadow exists on
34       the system.
35
36       These checks are the following:
37
38       •   every passwd entry has a matching shadow entry, and every shadow
39           entry has a matching passwd entry
40
41       •   passwords are specified in the shadowed file
42
43       •   shadow entries have the correct number of fields
44
45       •   shadow entries are unique in shadow
46
47       •   the last password changes are not in the future
48
49       The checks for correct number of fields and unique user name are fatal.
50       If the entry has the wrong number of fields, the user will be prompted
51       to delete the entire line. If the user does not answer affirmatively,
52       all further checks are bypassed. An entry with a duplicated user name
53       is prompted for deletion, but the remaining checks will still be made.
54       All other errors are warnings and the user is encouraged to run the
55       usermod command to correct the error.
56
57       The commands which operate on the /etc/passwd file are not able to
58       alter corrupted or duplicated entries.  pwck should be used in those
59       circumstances to remove the offending entry.
60

OPTIONS

62       The -r and -s options cannot be combined.
63
64       The options which apply to the pwck command are:
65
66       --badname
67           Allow names that do not conform to standards.
68
69       -h, --help
70           Display help message and exit.
71
72       -q, --quiet
73           Report errors only. The warnings which do not require any action
74           from the user won't be displayed.
75
76       -r, --read-only
77           Execute the pwck command in read-only mode.
78
79       -R, --root CHROOT_DIR
80           Apply changes in the CHROOT_DIR directory and use the configuration
81           files from the CHROOT_DIR directory. Only absolute paths are
82           supported.
83
84       -s, --sort
85           Sort entries in /etc/passwd and /etc/shadow by UID.
86
87       By default, pwck operates on the files /etc/passwd and /etc/shadow. The
88       user may select alternate files with the passwd and shadow parameters.
89

CONFIGURATION

91       The following configuration variables in /etc/login.defs change the
92       behavior of this tool:
93
94       NONEXISTENT (string)
95           If a system account intentionally does not have a home directory
96           that exists, this string can be provided in the /etc/passwd entry
97           for the account to indicate this. The result is that pwck will not
98           emit a spurious warning for this account.
99
100       PASS_MAX_DAYS (number)
101           The maximum number of days a password may be used. If the password
102           is older than this, a password change will be forced. If not
103           specified, -1 will be assumed (which disables the restriction).
104
105       PASS_MIN_DAYS (number)
106           The minimum number of days allowed between password changes. Any
107           password changes attempted sooner than this will be rejected. If
108           not specified, 0 will be assumed (which disables the restriction).
109
110       PASS_WARN_AGE (number)
111           The number of days warning given before a password expires. A zero
112           means warning is given only upon the day of expiration, a negative
113           value means no warning is given. If not specified, no warning will
114           be provided.
115

FILES

117       /etc/group
118           Group account information.
119
120       /etc/passwd
121           User account information.
122
123       /etc/shadow
124           Secure user account information.
125

EXIT VALUES

127       The pwck command exits with the following values:
128
129       0
130           success
131
132       1
133           invalid command syntax
134
135       2
136           one or more bad password entries
137
138       3
139           can't open password files
140
141       4
142           can't lock password files
143
144       5
145           can't update password files
146
147       6
148           can't sort password files
149

SEE ALSO

151       group(5), grpck(8), passwd(5), shadow(5), usermod(8).
152
153
154
155shadow-utils 4.12.3               11/29/2022                           PWCK(8)
Impressum