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 -h, --help
66 Display help message and exit.
67
68 -q, --quiet
69 Report errors only. The warnings which do not require any action
70 from the user won't be displayed.
71
72 -r, --read-only
73 Execute the pwck command in read-only mode.
74
75 -R, --root CHROOT_DIR
76 Apply changes in the CHROOT_DIR directory and use the configuration
77 files from the CHROOT_DIR directory.
78
79 -s, --sort
80 Sort entries in /etc/passwd and /etc/shadow by UID.
81
82 By default, pwck operates on the files /etc/passwd and /etc/shadow. The
83 user may select alternate files with the passwd and shadow parameters.
84
86 The following configuration variables in /etc/login.defs change the
87 behavior of this tool:
88
89 PASS_MAX_DAYS (number)
90 The maximum number of days a password may be used. If the password
91 is older than this, a password change will be forced. If not
92 specified, -1 will be assumed (which disables the restriction).
93
94 PASS_MIN_DAYS (number)
95 The minimum number of days allowed between password changes. Any
96 password changes attempted sooner than this will be rejected. If
97 not specified, -1 will be assumed (which disables the restriction).
98
99 PASS_WARN_AGE (number)
100 The number of days warning given before a password expires. A zero
101 means warning is given only upon the day of expiration, a negative
102 value means no warning is given. If not specified, no warning will
103 be provided.
104
106 /etc/group
107 Group account information.
108
109 /etc/passwd
110 User account information.
111
112 /etc/shadow
113 Secure user account information.
114
116 The pwck command exits with the following values:
117
118 0
119 success
120
121 1
122 invalid command syntax
123
124 2
125 one or more bad password entries
126
127 3
128 can't open password files
129
130 4
131 can't lock password files
132
133 5
134 can't update password files
135
136 6
137 can't sort password files
138
140 group(5), grpck(8), passwd(5), shadow(5), usermod(8).
141
142
143
144shadow-utils 4.6 09/02/2019 PWCK(8)