1PWCK(8) System Management Commands PWCK(8)
2
3
4
6 pwck - verify integrity of password files
7
9 pwck [-q] [-s] [passwd [ shadow ]]
10
11 pwck [-q] [-r] [passwd [ shadow ]]
12
14 The pwck command verifies the integrity of the users and authentication
15 information. It checks that all entries in /etc/passwd and /etc/shadow
16 have the proper format and contain valid data. The user is prompted to
17 delete entries that are improperly formatted or which have other
18 uncorrectable errors.
19
20 Checks are made to verify that each entry has:
21
22 · the correct number of fields
23
24 · a unique and valid user name
25
26 · a valid user and group identifier
27
28 · a valid primary group
29
30 · a valid home directory
31
32 · a valid login shell
33
34 shadow checks are enabled when a second file parameter is specified or
35 when /etc/shadow exists on the system.
36
37 These checks are the following:
38
39 · every passwd entry has a matching shadow entry, and every shadow
40 entry has a matching passwd entry
41
42 · passwords are specified in the shadowed file
43
44 · shadow entries have the correct number of fields
45
46 · shadow entries are unique in shadow
47
48 · the last password changes are not in the future
49
50 The checks for correct number of fields and unique user name are fatal.
51 If the entry has the wrong number of fields, the user will be prompted
52 to delete the entire line. If the user does not answer affirmatively,
53 all further checks are bypassed. An entry with a duplicated user name
54 is prompted for deletion, but the remaining checks will still be made.
55 All other errors are warning and the user is encouraged to run the
56 usermod command to correct the error.
57
58 The commands which operate on the /etc/passwd file are not able to
59 alter corrupted or duplicated entries. pwck should be used in those
60 circumstances to remove the offending entry.
61
63 The options which apply to the pwck command are:
64
65 -q
66 Report errors only. The warnings which do not require any action
67 from the user won´t be displayed.
68
69 -r
70 Execute the pwck command in read-only mode.
71
72 -s
73 Sort entries in /etc/passwd and /etc/shadow by UID.
74
75 By default, pwck operates on the files /etc/passwd and /etc/shadow. The
76 user may select alternate files with the passwd and shadow parameters.
77
79 The following configuration variables in /etc/login.defs change the
80 behavior of this tool:
81
82 PASS_MAX_DAYS (number)
83 The maximum number of days a password may be used. If the password
84 is older than this, a password change will be forced. If not
85 specified, -1 will be assumed (which disables the restriction).
86
87 PASS_MIN_DAYS (number)
88 The minimum number of days allowed between password changes. Any
89 password changes attempted sooner than this will be rejected. If
90 not specified, -1 will be assumed (which disables the restriction).
91
92 PASS_WARN_AGE (number)
93 The number of days warning given before a password expires. A zero
94 means warning is given only upon the day of expiration, a negative
95 value means no warning is given. If not specified, no warning will
96 be provided.
97
99 /etc/group
100 Group account information.
101
102 /etc/passwd
103 User account information.
104
105 /etc/shadow
106 Secure user account information.
107
109 The pwck command exits with the following values:
110
111 0
112 success
113
114 1
115 invalid command syntax
116
117 2
118 one or more bad password entries
119
120 3
121 can´t open password files
122
123 4
124 can´t lock password files
125
126 5
127 can´t update password files
128
129 6
130 can´t sort password files
131
133 group(5), grpck(8), passwd(5), shadow(5), usermod(8).
134
135
136
137System Management Commands 07/24/2009 PWCK(8)