1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright (c) 1996 - 1998, Marek Michałkiewicz
4 Copyright (c) 2000 - 2006, Tomasz Kłoczko
5 Copyright (c) 2007 - 2008, Nicolas François
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions
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.
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.
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">
40 <refentry id='pwconv.8'>
43 <refentrytitle>pwconv</refentrytitle>
44 <manvolnum>8</manvolnum>
45 <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
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>
55 <refsynopsisdiv id='synopsis'>
57 <command>pwconv</command>
60 <command>pwunconv</command>
63 <command>grpconv</command>
66 <command>grpunconv</command>
70 <refsect1 id='description'>
71 <title>DESCRIPTION</title>
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>.
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>.)
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>.
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>.
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>.
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>.
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>.
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.
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>.
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.
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.
163 <refsect1 id='configuration'>
164 <title>CONFIGURATION</title>
166 The following configuration variable in
167 <filename>/etc/login.defs</filename> changes the behavior of
168 <command>grpconv</command> and <command>grpunconv</command>:
171 &MAX_MEMBERS_PER_GROUP;
174 The following configuration variables in
175 <filename>/etc/login.defs</filename> change the behavior of
176 <command>pwconv</command>:
186 <refsect1 id='files'>
190 <term><filename>/etc/login.defs</filename></term>
192 <para>Shadow password suite configuration.</para>
198 <refsect1 id='see_also'>
199 <title>SEE ALSO</title>
202 <refentrytitle>grpck</refentrytitle><manvolnum>8</manvolnum>
205 <refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
208 <refentrytitle>pwck</refentrytitle><manvolnum>8</manvolnum>
209 </citerefentry><phrase condition="tcb">,
211 <refentrytitle>tcb_convert</refentrytitle><manvolnum>8</manvolnum>
214 <refentrytitle>tcb_unconvert</refentrytitle><manvolnum>8</manvolnum>
215 </citerefentry></phrase>.