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

NAME

6       pwck - verify integrity of password files
7

SYNOPSIS

9       pwck [options] [passwd [ shadow ]]
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       shadow checks are enabled when a second file parameter is specified or
33       when /etc/shadow exists on the system.
34
35       These checks are the following:
36
37       •   every passwd entry has a matching shadow entry, and every shadow
38           entry has a matching passwd entry
39
40       •   passwords are specified in the shadowed file
41
42       •   shadow entries have the correct number of fields
43
44       •   shadow entries are unique in shadow
45
46       •   the last password changes are not in the future
47
48       The checks for correct number of fields and unique user name are fatal.
49       If the entry has the wrong number of fields, the user will be prompted
50       to delete the entire line. If the user does not answer affirmatively,
51       all further checks are bypassed. An entry with a duplicated user name
52       is prompted for deletion, but the remaining checks will still be made.
53       All other errors are warning and the user is encouraged to run the
54       usermod command to correct the error.
55
56       The commands which operate on the /etc/passwd file are not able to
57       alter corrupted or duplicated entries.  pwck should be used in those
58       circumstances to remove the offending entry.
59

OPTIONS

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

CONFIGURATION

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

FILES

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

EXIT VALUES

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

SEE ALSO

149       group(5), grpck(8), passwd(5), shadow(5), usermod(8).
150
151
152
153shadow-utils 4.9                  11/19/2021                           PWCK(8)
Impressum