1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright (c) 1992 , Julianne Frances Haugh
4 Copyright (c) 2007 - 2009, Nicolas François
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
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.
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.
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">
37 <refentry id='pwck.8'>
38 <!-- $Id: pwck.8.xml 3023 2009-06-20 13:02:33Z nekral-guest $ -->
40 <refentrytitle>pwck</refentrytitle>
41 <manvolnum>8</manvolnum>
42 <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
44 <refnamediv id='name'>
45 <refname>pwck</refname>
46 <refpurpose>verify integrity of password files</refpurpose>
48 <!-- body begins here -->
49 <refsynopsisdiv id='synopsis'>
51 <command>pwck</command>
52 <arg choice='opt'>-q </arg>
53 <arg choice='opt'>-s </arg>
56 <replaceable>passwd</replaceable>
60 <replaceable>shadow</replaceable>
66 <command>pwck</command>
67 <arg choice='opt'>-q </arg>
68 <arg choice='opt'>-r </arg>
71 <replaceable>passwd</replaceable>
75 <replaceable>shadow</replaceable>
82 <refsect1 id='description'>
83 <title>DESCRIPTION</title>
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.
93 <para>Checks are made to verify that each entry has:</para>
94 <itemizedlist mark='bullet'>
96 <para>the correct number of fields</para>
99 <para>a unique and valid user name</para>
102 <para>a valid user and group identifier</para>
105 <para>a valid primary group</para>
108 <para> a valid home directory</para>
111 <para>a valid login shell</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.
121 These checks are the following:
123 <itemizedlist mark='bullet'>
126 every passwd entry has a matching shadow entry, and every shadow
127 entry has a matching passwd entry
131 <para>passwords are specified in the shadowed file</para>
134 <para>shadow entries have the correct number of fields</para>
137 <para>shadow entries are unique in shadow</para>
140 <para>the last password changes are not in the future</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
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.
163 <refsect1 id='options'>
164 <title>OPTIONS</title>
166 The options which apply to the <command>pwck</command> command are:
168 <variablelist remap='IP'>
175 Report errors only. The warnings which do not require any
176 action from the user won't be displayed.
186 Execute the <command>pwck</command> command in read-only mode.
196 Sort entries in <filename>/etc/passwd</filename> and
197 <filename>/etc/shadow</filename> by UID.
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>
212 <refsect1 id='configuration'>
213 <title>CONFIGURATION</title>
215 The following configuration variables in
216 <filename>/etc/login.defs</filename> change the behavior of this
226 <refsect1 id='files'>
230 <term><filename>/etc/group</filename></term>
232 <para>Group account information.</para>
236 <term><filename>/etc/passwd</filename></term>
238 <para>User account information.</para>
242 <term><filename>/etc/shadow</filename></term>
244 <para>Secure user account information.</para>
250 <refsect1 id='exit_values'>
251 <title>EXIT VALUES</title>
253 The <command>pwck</command> command exits with the following values:
256 <term><replaceable>0</replaceable></term>
262 <term><replaceable>1</replaceable></term>
264 <para>invalid command syntax</para>
268 <term><replaceable>2</replaceable></term>
270 <para>one or more bad password entries</para>
274 <term><replaceable>3</replaceable></term>
276 <para>can't open password files</para>
280 <term><replaceable>4</replaceable></term>
282 <para>can't lock password files</para>
286 <term><replaceable>5</replaceable></term>
288 <para>can't update password files</para>
292 <term><replaceable>6</replaceable></term>
294 <para>can't sort password files</para>
301 <refsect1 id='see_also'>
302 <title>SEE ALSO</title>
305 <refentrytitle>group</refentrytitle><manvolnum>5</manvolnum>
308 <refentrytitle>grpck</refentrytitle><manvolnum>8</manvolnum>
311 <refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum>
314 <refentrytitle>shadow</refentrytitle><manvolnum>5</manvolnum>
317 <refentrytitle>usermod</refentrytitle><manvolnum>8</manvolnum>