1PWCK(8) System Management Commands PWCK(8)
2
3
4
6 pwck - verify integrity of password files
7
9 pwck [options] [passwd [ shadow ]]
10
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
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
89 The following configuration variables in /etc/login.defs change the
90 behavior of this tool:
91
92 PASS_MAX_DAYS (number)
93 The maximum number of days a password may be used. If the password
94 is older than this, a password change will be forced. If not
95 specified, -1 will be assumed (which disables the restriction).
96
97 PASS_MIN_DAYS (number)
98 The minimum number of days allowed between password changes. Any
99 password changes attempted sooner than this will be rejected. If
100 not specified, -1 will be assumed (which disables the restriction).
101
102 PASS_WARN_AGE (number)
103 The number of days warning given before a password expires. A zero
104 means warning is given only upon the day of expiration, a negative
105 value means no warning is given. If not specified, no warning will
106 be provided.
107
109 /etc/group
110 Group account information.
111
112 /etc/passwd
113 User account information.
114
115 /etc/shadow
116 Secure user account information.
117
119 The pwck command exits with the following values:
120
121 0
122 success
123
124 1
125 invalid command syntax
126
127 2
128 one or more bad password entries
129
130 3
131 can't open password files
132
133 4
134 can't lock password files
135
136 5
137 can't update password files
138
139 6
140 can't sort password files
141
143 group(5), grpck(8), passwd(5), shadow(5), usermod(8).
144
145
146
147shadow-utils 4.8.1 03/24/2020 PWCK(8)