Initial commit for Tizen
[profile/extras/shadow-utils.git] / man / pwck.8.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    Copyright (c) 1992       , Julianne Frances Haugh
4    Copyright (c) 2007 - 2009, Nicolas François
5    All rights reserved.
6   
7    Redistribution and use in source and binary forms, with or without
8    modification, are permitted provided that the following conditions
9    are met:
10    1. Redistributions of source code must retain the above copyright
11       notice, this list of conditions and the following disclaimer.
12    2. Redistributions in binary form must reproduce the above copyright
13       notice, this list of conditions and the following disclaimer in the
14       documentation and/or other materials provided with the distribution.
15    3. The name of the copyright holders or contributors may not be used to
16       endorse or promote products derived from this software without
17       specific prior written permission.
18   
19    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22    PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
23    HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 -->
31 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
32   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
33 <!ENTITY PASS_MAX_DAYS         SYSTEM "login.defs.d/PASS_MAX_DAYS.xml">
34 <!ENTITY PASS_MIN_DAYS         SYSTEM "login.defs.d/PASS_MIN_DAYS.xml">
35 <!ENTITY PASS_WARN_AGE         SYSTEM "login.defs.d/PASS_WARN_AGE.xml">
36 ]>
37 <refentry id='pwck.8'>
38   <!-- $Id: pwck.8.xml 3023 2009-06-20 13:02:33Z nekral-guest $ -->
39   <refmeta>
40     <refentrytitle>pwck</refentrytitle>
41     <manvolnum>8</manvolnum>
42     <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
43   </refmeta>
44   <refnamediv id='name'>
45     <refname>pwck</refname>
46     <refpurpose>verify integrity of password files</refpurpose>
47   </refnamediv>
48   <!-- body begins here -->
49   <refsynopsisdiv id='synopsis'>
50     <cmdsynopsis>
51       <command>pwck</command>
52       <arg choice='opt'>-q </arg>
53       <arg choice='opt'>-s </arg>
54       <arg choice='opt'>
55         <arg choice='plain'>
56           <replaceable>passwd</replaceable>
57         </arg>
58         <arg choice='opt'>
59           <arg choice='plain'>
60             <replaceable>shadow</replaceable>
61           </arg>
62         </arg>
63       </arg>
64     </cmdsynopsis>
65     <cmdsynopsis>
66       <command>pwck</command>
67       <arg choice='opt'>-q </arg>
68       <arg choice='opt'>-r </arg>
69       <arg choice='opt'>
70         <arg choice='plain'>
71           <replaceable>passwd</replaceable>
72         </arg>
73         <arg choice='opt'>
74         <arg choice='plain'>
75           <replaceable>shadow</replaceable>
76         </arg>
77         </arg>
78       </arg>
79     </cmdsynopsis>
80   </refsynopsisdiv>
81
82   <refsect1 id='description'>
83     <title>DESCRIPTION</title>
84     <para>
85       The <command>pwck</command> command verifies the integrity of the
86       users and authentication information. It checks that all entries in
87       <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename>
88       have the proper format and contain valid data.
89       The user is prompted to delete entries that are
90       improperly formatted or which have other uncorrectable errors.
91     </para>
92
93     <para>Checks are made to verify that each entry has:</para>
94     <itemizedlist mark='bullet'>
95       <listitem>
96         <para>the correct number of fields</para>
97       </listitem>
98       <listitem>
99         <para>a unique and valid user name</para>
100       </listitem>
101       <listitem>
102         <para>a valid user and group identifier</para>
103       </listitem>
104       <listitem>
105         <para>a valid primary group</para>
106       </listitem>
107       <listitem>
108         <para> a valid home directory</para>
109       </listitem>
110       <listitem>
111         <para>a valid login shell</para>
112       </listitem>
113     </itemizedlist>
114
115     <para>
116       <filename>shadow</filename> checks are enabled when a second file
117       parameter is specified or when <filename>/etc/shadow</filename>
118       exists on the system.
119     </para>
120     <para>
121       These checks are the following:
122     </para>
123     <itemizedlist mark='bullet'>
124       <listitem>
125         <para>
126           every passwd entry has a matching shadow entry, and every shadow
127           entry has a matching passwd entry
128         </para>
129       </listitem>
130       <listitem>
131         <para>passwords are specified in the shadowed file</para>
132       </listitem>
133       <listitem>
134         <para>shadow entries have the correct number of fields</para>
135       </listitem>
136       <listitem>
137         <para>shadow entries are unique in shadow</para>
138       </listitem>
139       <listitem>
140         <para>the last password changes are not in the future</para>
141       </listitem>
142     </itemizedlist>
143
144     <para>
145       The checks for correct number of fields and unique user name are
146       fatal. If the entry has the wrong number of fields, the user will be
147       prompted to delete the entire line. If the user does not answer
148       affirmatively, all further checks are bypassed. An entry with a
149       duplicated user name is prompted for deletion, but the remaining
150       checks will still be made. All other errors are warning and the user
151       is encouraged to run the <command>usermod</command> command to correct
152       the error.
153     </para>
154
155     <para>
156       The commands which operate on the <filename>/etc/passwd</filename>
157       file are not able to alter corrupted or duplicated entries.
158       <command>pwck</command> should be used in those circumstances to
159       remove the offending entry.
160     </para>
161   </refsect1>
162
163   <refsect1 id='options'>
164     <title>OPTIONS</title>
165     <para>
166       The options which apply to the <command>pwck</command> command are:
167     </para>
168     <variablelist remap='IP'>
169       <varlistentry>
170         <term>
171           <option>-q</option>
172         </term>
173         <listitem>
174           <para>
175             Report errors only. The warnings which do not require any
176             action from the user won't be displayed.
177           </para>
178         </listitem>
179       </varlistentry>
180       <varlistentry>
181         <term>
182           <option>-r</option>
183         </term>
184         <listitem>
185           <para>
186             Execute the <command>pwck</command> command in read-only mode.
187           </para>
188         </listitem>
189       </varlistentry>
190       <varlistentry>
191         <term>
192           <option>-s</option>
193         </term>
194         <listitem>
195           <para>
196             Sort entries in <filename>/etc/passwd</filename> and
197             <filename>/etc/shadow</filename> by UID.
198           </para>
199         </listitem>
200       </varlistentry>
201     </variablelist>
202
203     <para>
204       By default, <command>pwck</command> operates on the files
205       <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename>.
206       The user may select alternate files with the <emphasis
207       remap='I'>passwd</emphasis> and <emphasis remap='I'>shadow</emphasis>
208       parameters.
209     </para>
210   </refsect1>
211
212   <refsect1 id='configuration'>
213     <title>CONFIGURATION</title>
214     <para>
215       The following configuration variables in
216       <filename>/etc/login.defs</filename> change the behavior of this
217       tool:
218     </para>
219     <variablelist>
220       &PASS_MAX_DAYS;
221       &PASS_MIN_DAYS;
222       &PASS_WARN_AGE;
223     </variablelist>
224   </refsect1>
225
226   <refsect1 id='files'>
227     <title>FILES</title>
228     <variablelist>
229       <varlistentry>
230         <term><filename>/etc/group</filename></term>
231         <listitem>
232           <para>Group account information.</para>
233         </listitem>
234       </varlistentry>
235       <varlistentry>
236         <term><filename>/etc/passwd</filename></term>
237         <listitem>
238           <para>User account information.</para>
239         </listitem>
240       </varlistentry>
241       <varlistentry>
242         <term><filename>/etc/shadow</filename></term>
243         <listitem>
244           <para>Secure user account information.</para>
245         </listitem>
246       </varlistentry>
247     </variablelist>
248   </refsect1>
249
250   <refsect1 id='exit_values'>
251     <title>EXIT VALUES</title>
252     <para>
253       The <command>pwck</command> command exits with the following values:
254       <variablelist>
255         <varlistentry>
256           <term><replaceable>0</replaceable></term>
257           <listitem>
258             <para>success</para>
259           </listitem>
260         </varlistentry>
261         <varlistentry>
262           <term><replaceable>1</replaceable></term>
263           <listitem>
264             <para>invalid command syntax</para>
265           </listitem>
266         </varlistentry>
267         <varlistentry>
268           <term><replaceable>2</replaceable></term>
269           <listitem>
270             <para>one or more bad password entries</para>
271           </listitem>
272         </varlistentry>
273         <varlistentry>
274           <term><replaceable>3</replaceable></term>
275           <listitem>
276             <para>can't open password files</para>
277           </listitem>
278         </varlistentry>
279         <varlistentry>
280           <term><replaceable>4</replaceable></term>
281           <listitem>
282             <para>can't lock password files</para>
283           </listitem>
284         </varlistentry>
285         <varlistentry>
286           <term><replaceable>5</replaceable></term>
287           <listitem>
288             <para>can't update password files</para>
289           </listitem>
290         </varlistentry>
291         <varlistentry>
292           <term><replaceable>6</replaceable></term>
293           <listitem>
294             <para>can't sort password files</para>
295           </listitem>
296         </varlistentry>
297       </variablelist>
298     </para>
299   </refsect1>
300
301   <refsect1 id='see_also'>
302     <title>SEE ALSO</title>
303     <para>
304       <citerefentry>
305         <refentrytitle>group</refentrytitle><manvolnum>5</manvolnum>
306       </citerefentry>,
307       <citerefentry>
308         <refentrytitle>grpck</refentrytitle><manvolnum>8</manvolnum>
309       </citerefentry>,
310       <citerefentry>
311         <refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum>
312       </citerefentry>,
313       <citerefentry>
314         <refentrytitle>shadow</refentrytitle><manvolnum>5</manvolnum>
315       </citerefentry>,
316       <citerefentry>
317         <refentrytitle>usermod</refentrytitle><manvolnum>8</manvolnum>
318       </citerefentry>.
319     </para>
320   </refsect1>
321 </refentry>