]> granicus.if.org Git - shadow/blob - man/pwconv.8.xml
* src/pwck.c: Document the sections closed by #endif
[shadow] / man / pwconv.8.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    Copyright (c) 1996 - 1998, Marek Michałkiewicz
4    Copyright (c) 2000 - 2006, Tomasz Kłoczko
5    Copyright (c) 2007 - 2008, Nicolas François
6    All rights reserved.
7   
8    Redistribution and use in source and binary forms, with or without
9    modification, are permitted provided that the following conditions
10    are met:
11    1. Redistributions of source code must retain the above copyright
12       notice, this list of conditions and the following disclaimer.
13    2. Redistributions in binary form must reproduce the above copyright
14       notice, this list of conditions and the following disclaimer in the
15       documentation and/or other materials provided with the distribution.
16    3. The name of the copyright holders or contributors may not be used to
17       endorse or promote products derived from this software without
18       specific prior written permission.
19   
20    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23    PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
24    HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 -->
32 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
33   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
34 <!ENTITY MAX_MEMBERS_PER_GROUP SYSTEM "login.defs.d/MAX_MEMBERS_PER_GROUP.xml">
35 <!ENTITY PASS_MAX_DAYS         SYSTEM "login.defs.d/PASS_MAX_DAYS.xml">
36 <!ENTITY PASS_MIN_DAYS         SYSTEM "login.defs.d/PASS_MIN_DAYS.xml">
37 <!ENTITY PASS_WARN_AGE         SYSTEM "login.defs.d/PASS_WARN_AGE.xml">
38 <!ENTITY USE_TCB               SYSTEM "login.defs.d/USE_TCB.xml">
39 ]>
40 <refentry id='pwconv.8'>
41   <!-- $Id$ -->
42   <refmeta>
43     <refentrytitle>pwconv</refentrytitle>
44     <manvolnum>8</manvolnum>
45     <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
46   </refmeta>
47   <refnamediv id='name'>
48     <refname>pwconv</refname>
49     <refname>pwunconv</refname>
50     <refname>grpconv</refname>
51     <refname>grpunconv</refname>
52     <refpurpose>convert to and from shadow passwords and groups</refpurpose>
53   </refnamediv>
54
55   <refsynopsisdiv id='synopsis'>
56     <cmdsynopsis>
57       <command>pwconv</command>
58     </cmdsynopsis>
59     <cmdsynopsis>
60       <command>pwunconv</command>
61     </cmdsynopsis>
62     <cmdsynopsis>
63       <command>grpconv</command>
64     </cmdsynopsis>
65     <cmdsynopsis>
66       <command>grpunconv</command>
67     </cmdsynopsis>
68   </refsynopsisdiv>
69
70   <refsect1 id='description'>
71     <title>DESCRIPTION</title>
72     <para>
73       The <command>pwconv</command> command creates <emphasis
74       remap='I'>shadow</emphasis> from <emphasis remap='I'>passwd</emphasis>
75       and an optionally existing <emphasis remap='I'>shadow</emphasis>.
76     </para>
77     <para condition="tcb">
78       <command>pwconv</command> does not work with
79       <option>USE_TCB</option> enabled. To convert to tcb passwords, you
80       should first use <command>pwconv</command> to convert to shadowed
81       passwords by disabling <option>USE_TCB</option> in
82       <filename>login.defs</filename> and then convert to tcb password
83       using <command>tcb_convert</command> (and re-enable
84       <option>USE_TCB</option> in <filename>login.defs</filename>.)
85     </para>
86
87     <para>
88       The <command>pwunconv</command> command creates <emphasis
89       remap='I'>passwd</emphasis> from <emphasis remap='I'>passwd</emphasis>
90       and <emphasis remap='I'>shadow</emphasis> and then removes <emphasis
91       remap='I'>shadow</emphasis>.
92     </para>
93     <para condition="tcb">
94       <command>pwunconv</command> does not work with
95       <option>USE_TCB</option> enabled. You should first switch back from
96       tcb to shadowed passwords using <command>tcb_unconvert</command>,
97       and then disable <option>USE_TCB</option> in
98       <filename>login.defs</filename> before using
99       <command>pwunconv</command>.
100     </para>
101
102     <para>
103       The <command>grpconv</command> command creates <emphasis
104       remap='I'>gshadow</emphasis> from <emphasis remap='I'>group</emphasis>
105       and an optionally existing <emphasis remap='I'>gshadow</emphasis>.
106     </para>
107
108     <para>
109       The <command>grpunconv</command> command creates <emphasis
110       remap='I'>group</emphasis> from <emphasis remap='I'>group</emphasis>
111       and <emphasis remap='I'>gshadow</emphasis> and then removes <emphasis
112       remap='I'>gshadow</emphasis>.
113     </para>
114
115     <para>
116       These four programs all operate on the normal and shadow password and
117       group files: <filename>/etc/passwd</filename>,
118       <filename>/etc/group</filename>, <filename>/etc/shadow</filename>, and
119       <filename>/etc/gshadow</filename>.
120     </para>
121
122     <para>
123       Each program acquires the necessary locks before conversion. 
124       <command>pwconv</command> and <command>grpconv</command> are similar. 
125       First, entries in the shadowed file which don't exist in the main file
126       are removed. Then, shadowed entries which don't have `x' as the
127       password in the main file are updated. Any missing shadowed entries
128       are added. Finally, passwords in the main file are replaced with `x'. 
129       These programs can be used for initial conversion as well to update
130       the shadowed file if the main file is edited by hand.
131     </para>
132
133     <para>
134       <command>pwconv</command> will use the values of <emphasis
135       remap='I'>PASS_MIN_DAYS</emphasis>, <emphasis
136       remap='I'>PASS_MAX_DAYS</emphasis>, and <emphasis
137       remap='I'>PASS_WARN_AGE</emphasis> from
138       <filename>/etc/login.defs</filename> when adding new entries to
139       <filename>/etc/shadow</filename>.
140     </para>
141
142     <para>
143       Likewise <command>pwunconv</command> and <command>grpunconv</command>
144       are similar. Passwords in the main file are updated from the shadowed
145       file. Entries which exist in the main file but not in the shadowed
146       file are left alone. Finally, the shadowed file is removed. Some
147       password aging information is lost by <command>pwunconv</command>. It
148       will convert what it can.
149     </para>
150   </refsect1>
151
152   <refsect1 id='bugs'>
153     <title>BUGS</title>
154     <para>
155       Errors in the password or group files (such as invalid or duplicate
156       entries) may cause these programs to loop forever or fail in other
157       strange ways. Please run <command>pwck</command> and
158       <command>grpck</command> to correct any such errors before converting
159       to or from shadow passwords or groups.
160     </para>
161   </refsect1>
162
163   <refsect1 id='configuration'>
164     <title>CONFIGURATION</title>
165     <para>
166       The following configuration variable in
167       <filename>/etc/login.defs</filename> changes the behavior of
168       <command>grpconv</command> and <command>grpunconv</command>:
169     </para>
170     <variablelist>
171       &MAX_MEMBERS_PER_GROUP;
172     </variablelist>
173     <para>
174       The following configuration variables in
175       <filename>/etc/login.defs</filename> change the behavior of
176       <command>pwconv</command>:
177     </para>
178     <variablelist>
179       &PASS_MAX_DAYS;
180       &PASS_MIN_DAYS;
181       &PASS_WARN_AGE;
182       &USE_TCB;
183     </variablelist>
184   </refsect1>
185
186   <refsect1 id='files'>
187     <title>FILES</title>
188     <variablelist>
189       <varlistentry>
190         <term><filename>/etc/login.defs</filename></term>
191         <listitem>
192           <para>Shadow password suite configuration.</para>
193         </listitem>
194       </varlistentry>
195     </variablelist>
196   </refsect1>
197
198   <refsect1 id='see_also'>
199     <title>SEE ALSO</title>
200     <para>
201       <citerefentry>
202         <refentrytitle>grpck</refentrytitle><manvolnum>8</manvolnum>
203       </citerefentry>,
204       <citerefentry>
205         <refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
206       </citerefentry>,
207       <citerefentry>
208         <refentrytitle>pwck</refentrytitle><manvolnum>8</manvolnum>
209       </citerefentry><phrase condition="tcb">,
210       <citerefentry>
211         <refentrytitle>tcb_convert</refentrytitle><manvolnum>8</manvolnum>
212       </citerefentry>,
213       <citerefentry>
214         <refentrytitle>tcb_unconvert</refentrytitle><manvolnum>8</manvolnum>
215       </citerefentry></phrase>.
216     </para>
217   </refsect1>
218 </refentry>