Initial commit for Tizen
[profile/extras/shadow-utils.git] / man / pwck.8
1 '\" t
2 .\"     Title: pwck
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5 .\"      Date: 02/16/2011
6 .\"    Manual: System Management Commands
7 .\"    Source: System Management Commands
8 .\"  Language: English
9 .\"
10 .TH "PWCK" "8" "02/16/2011" "System Management Commands" "System Management Commands"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 pwck \- verify integrity of password files
32 .SH "SYNOPSIS"
33 .HP \w'\fBpwck\fR\ 'u
34 \fBpwck\fR [\-q] [\-s] [\fIpasswd\fR\ [\ \fIshadow\fR\ ]]
35 .HP \w'\fBpwck\fR\ 'u
36 \fBpwck\fR [\-q] [\-r] [\fIpasswd\fR\ [\ \fIshadow\fR\ ]]
37 .SH "DESCRIPTION"
38 .PP
39 The
40 \fBpwck\fR
41 command verifies the integrity of the users and authentication information\&. It checks that all entries in
42 /etc/passwd
43 and
44 /etc/shadow
45 have the proper format and contain valid data\&. The user is prompted to delete entries that are improperly formatted or which have other uncorrectable errors\&.
46 .PP
47 Checks are made to verify that each entry has:
48 .sp
49 .RS 4
50 .ie n \{\
51 \h'-04'\(bu\h'+03'\c
52 .\}
53 .el \{\
54 .sp -1
55 .IP \(bu 2.3
56 .\}
57 the correct number of fields
58 .RE
59 .sp
60 .RS 4
61 .ie n \{\
62 \h'-04'\(bu\h'+03'\c
63 .\}
64 .el \{\
65 .sp -1
66 .IP \(bu 2.3
67 .\}
68 a unique and valid user name
69 .RE
70 .sp
71 .RS 4
72 .ie n \{\
73 \h'-04'\(bu\h'+03'\c
74 .\}
75 .el \{\
76 .sp -1
77 .IP \(bu 2.3
78 .\}
79 a valid user and group identifier
80 .RE
81 .sp
82 .RS 4
83 .ie n \{\
84 \h'-04'\(bu\h'+03'\c
85 .\}
86 .el \{\
87 .sp -1
88 .IP \(bu 2.3
89 .\}
90 a valid primary group
91 .RE
92 .sp
93 .RS 4
94 .ie n \{\
95 \h'-04'\(bu\h'+03'\c
96 .\}
97 .el \{\
98 .sp -1
99 .IP \(bu 2.3
100 .\}
101 a valid home directory
102 .RE
103 .sp
104 .RS 4
105 .ie n \{\
106 \h'-04'\(bu\h'+03'\c
107 .\}
108 .el \{\
109 .sp -1
110 .IP \(bu 2.3
111 .\}
112 a valid login shell
113 .RE
114 .PP
115
116 shadow
117 checks are enabled when a second file parameter is specified or when
118 /etc/shadow
119 exists on the system\&.
120 .PP
121 These checks are the following:
122 .sp
123 .RS 4
124 .ie n \{\
125 \h'-04'\(bu\h'+03'\c
126 .\}
127 .el \{\
128 .sp -1
129 .IP \(bu 2.3
130 .\}
131 every passwd entry has a matching shadow entry, and every shadow entry has a matching passwd entry
132 .RE
133 .sp
134 .RS 4
135 .ie n \{\
136 \h'-04'\(bu\h'+03'\c
137 .\}
138 .el \{\
139 .sp -1
140 .IP \(bu 2.3
141 .\}
142 passwords are specified in the shadowed file
143 .RE
144 .sp
145 .RS 4
146 .ie n \{\
147 \h'-04'\(bu\h'+03'\c
148 .\}
149 .el \{\
150 .sp -1
151 .IP \(bu 2.3
152 .\}
153 shadow entries have the correct number of fields
154 .RE
155 .sp
156 .RS 4
157 .ie n \{\
158 \h'-04'\(bu\h'+03'\c
159 .\}
160 .el \{\
161 .sp -1
162 .IP \(bu 2.3
163 .\}
164 shadow entries are unique in shadow
165 .RE
166 .sp
167 .RS 4
168 .ie n \{\
169 \h'-04'\(bu\h'+03'\c
170 .\}
171 .el \{\
172 .sp -1
173 .IP \(bu 2.3
174 .\}
175 the last password changes are not in the future
176 .RE
177 .PP
178 The checks for correct number of fields and unique user name are fatal\&. If the entry has the wrong number of fields, the user will be prompted to delete the entire line\&. If the user does not answer affirmatively, all further checks are bypassed\&. An entry with a duplicated user name is prompted for deletion, but the remaining checks will still be made\&. All other errors are warning and the user is encouraged to run the
179 \fBusermod\fR
180 command to correct the error\&.
181 .PP
182 The commands which operate on the
183 /etc/passwd
184 file are not able to alter corrupted or duplicated entries\&.
185 \fBpwck\fR
186 should be used in those circumstances to remove the offending entry\&.
187 .SH "OPTIONS"
188 .PP
189 The options which apply to the
190 \fBpwck\fR
191 command are:
192 .PP
193 \fB\-q\fR
194 .RS 4
195 Report errors only\&. The warnings which do not require any action from the user won\*(Aqt be displayed\&.
196 .RE
197 .PP
198 \fB\-r\fR
199 .RS 4
200 Execute the
201 \fBpwck\fR
202 command in read\-only mode\&.
203 .RE
204 .PP
205 \fB\-s\fR
206 .RS 4
207 Sort entries in
208 /etc/passwd
209 and
210 /etc/shadow
211 by UID\&.
212 .RE
213 .PP
214 By default,
215 \fBpwck\fR
216 operates on the files
217 /etc/passwd
218 and
219 /etc/shadow\&. The user may select alternate files with the
220 \fIpasswd\fR
221 and
222 \fIshadow\fR
223 parameters\&.
224 .SH "CONFIGURATION"
225 .PP
226 The following configuration variables in
227 /etc/login\&.defs
228 change the behavior of this tool:
229 .PP
230 \fBPASS_MAX_DAYS\fR (number)
231 .RS 4
232 The maximum number of days a password may be used\&. If the password is older than this, a password change will be forced\&. If not specified, \-1 will be assumed (which disables the restriction)\&.
233 .RE
234 .PP
235 \fBPASS_MIN_DAYS\fR (number)
236 .RS 4
237 The minimum number of days allowed between password changes\&. Any password changes attempted sooner than this will be rejected\&. If not specified, \-1 will be assumed (which disables the restriction)\&.
238 .RE
239 .PP
240 \fBPASS_WARN_AGE\fR (number)
241 .RS 4
242 The number of days warning given before a password expires\&. A zero means warning is given only upon the day of expiration, a negative value means no warning is given\&. If not specified, no warning will be provided\&.
243 .RE
244 .SH "FILES"
245 .PP
246 /etc/group
247 .RS 4
248 Group account information\&.
249 .RE
250 .PP
251 /etc/passwd
252 .RS 4
253 User account information\&.
254 .RE
255 .PP
256 /etc/shadow
257 .RS 4
258 Secure user account information\&.
259 .RE
260 .SH "EXIT VALUES"
261 .PP
262 The
263 \fBpwck\fR
264 command exits with the following values:
265 .PP
266 \fI0\fR
267 .RS 4
268 success
269 .RE
270 .PP
271 \fI1\fR
272 .RS 4
273 invalid command syntax
274 .RE
275 .PP
276 \fI2\fR
277 .RS 4
278 one or more bad password entries
279 .RE
280 .PP
281 \fI3\fR
282 .RS 4
283 can\*(Aqt open password files
284 .RE
285 .PP
286 \fI4\fR
287 .RS 4
288 can\*(Aqt lock password files
289 .RE
290 .PP
291 \fI5\fR
292 .RS 4
293 can\*(Aqt update password files
294 .RE
295 .PP
296 \fI6\fR
297 .RS 4
298 can\*(Aqt sort password files
299 .RE
300 .SH "SEE ALSO"
301 .PP
302
303 \fBgroup\fR(5),
304 \fBgrpck\fR(8),
305 \fBpasswd\fR(5),
306 \fBshadow\fR(5),
307 \fBusermod\fR(8)\&.