]> granicus.if.org Git - shadow/blob - man/newusers.8.xml
Remove generated file.
[shadow] / man / newusers.8.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    Copyright (c) 1991 - 1994, 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 ENCRYPT_METHOD        SYSTEM "login.defs.d/ENCRYPT_METHOD.xml">
34 <!ENTITY GID_MAX               SYSTEM "login.defs.d/GID_MAX.xml">
35 <!ENTITY MAX_MEMBERS_PER_GROUP SYSTEM "login.defs.d/MAX_MEMBERS_PER_GROUP.xml">
36 <!ENTITY MD5_CRYPT_ENAB        SYSTEM "login.defs.d/MD5_CRYPT_ENAB.xml">
37 <!ENTITY PASS_MAX_DAYS         SYSTEM "login.defs.d/PASS_MAX_DAYS.xml">
38 <!ENTITY PASS_MIN_DAYS         SYSTEM "login.defs.d/PASS_MIN_DAYS.xml">
39 <!ENTITY PASS_WARN_AGE         SYSTEM "login.defs.d/PASS_WARN_AGE.xml">
40 <!ENTITY SHA_CRYPT_MIN_ROUNDS  SYSTEM "login.defs.d/SHA_CRYPT_MIN_ROUNDS.xml">
41 <!ENTITY SYS_GID_MAX           SYSTEM "login.defs.d/SYS_GID_MAX.xml">
42 <!ENTITY SYS_UID_MAX           SYSTEM "login.defs.d/SYS_UID_MAX.xml">
43 <!ENTITY UID_MAX               SYSTEM "login.defs.d/UID_MAX.xml">
44 <!ENTITY UMASK                 SYSTEM "login.defs.d/UMASK.xml">
45 ]>
46
47 <refentry id='newusers.8'>
48   <!-- $Id$ -->
49   <refmeta>
50     <refentrytitle>newusers</refentrytitle>
51     <manvolnum>8</manvolnum>
52     <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
53   </refmeta>
54   <refnamediv id='name'>
55     <refname>newusers</refname>
56     <refpurpose>update and create new users in batch</refpurpose>
57   </refnamediv>
58   <!-- body begins here -->
59   <refsynopsisdiv id='synopsis'>
60     <cmdsynopsis>
61       <command>newusers</command>
62       <arg choice='opt'>
63         <replaceable>options</replaceable>
64         <replaceable>new_users</replaceable>
65       </arg>
66     </cmdsynopsis>
67   </refsynopsisdiv>
68
69   <refsect1 id='description'>
70     <title>DESCRIPTION</title>
71     <para>
72       The <command>newusers</command> command reads a file of user name and
73       clear-text password pairs and uses this information to update a group
74       of existing users or to create new users. Each line is in the same format
75       as the standard password file (see
76       <citerefentry><refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum>
77       </citerefentry>) with the exceptions explained below:
78     </para>
79     <para>pw_name:pw_passwd:pw_uid:pw_gid:pw_gecos:pw_dir:pw_shell</para>
80
81     <variablelist remap='IP'>
82       <varlistentry>
83         <term>
84           <emphasis remap='I'>pw_name</emphasis>
85         </term>
86         <listitem>
87           <para>
88             This is the name of the user.
89           </para>
90           <para>
91             It can be the name of a new user or the name of an existing
92             user (or an user created before by
93             <command>newusers</command>).  In case of an existing user,
94             the user's information will be changed, otherwise a new user
95             will be created.
96           </para>
97         </listitem>
98       </varlistentry>
99       <varlistentry>
100         <term>
101           <emphasis remap='I'>pw_passwd</emphasis>
102         </term>
103         <listitem>
104           <para>
105             This field will be encrypted and used as the new value of the
106             encrypted password.
107           </para>
108         </listitem>
109       </varlistentry>
110       <varlistentry>
111         <term>
112           <emphasis remap='I'>pw_uid</emphasis>
113         </term>
114         <listitem>
115           <para>
116             This field is used to define the UID of the user.
117           </para>
118           <para>
119             If the field is empty, an new (unused) UID will be defined
120             automatically by <command>newusers</command>.
121           </para>
122           <para>
123             If this field contains a number, this number will be used as
124             the UID.
125           </para>
126           <para>
127             If this field contains the name of an existing user (or the
128             name of an user created before by
129             <command>newusers</command>), the UID of the specified user
130             will be used.
131           </para>
132           <para>
133             If the UID of an existing user is changed, the files ownership
134             of the user's file should be fixed manually.
135           </para>
136         </listitem>
137       </varlistentry>
138       <varlistentry>
139         <term>
140           <emphasis remap='I'>pw_gid</emphasis>
141         </term>
142         <listitem>
143           <para>
144             This field is used to define the primary group ID for the user.
145           </para>
146           <para>
147             If this field contains the name of an existing group (or a
148             group created before by <command>newusers</command>), the GID
149             of this group will be used as the primary group ID for the
150             user.
151           </para>
152           <para>
153             If this field is a number, this number will be used as the
154             primary group ID of the user.  If no groups exist with this
155             GID, a new group will be created with this GID, and the name
156             of the user.
157           </para>
158           <para>
159             If this field is empty, a new group will be created with the
160             name of the user and a GID will be automatically defined by
161             <command>newusers</command> to be used as the primary group ID
162             for the user and as the GID for the new group.
163           </para>
164           <para>
165             If this field contains the name of a group which does not
166             exist (and was not created earlier wbefore by
167             <command>newusers</command>), a new group will be created with
168             the specified name and a GID will be automatically defined by
169             <command>newusers</command> to be used as the primary group ID
170             for the user and Gs the ID for the new group.
171           </para>
172         </listitem>
173       </varlistentry>
174       <varlistentry>
175         <term>
176           <emphasis remap='I'>pw_gecos</emphasis>
177         </term>
178         <listitem>
179           <para>
180             This field is copied in the GECOS field of the user.
181           </para>
182         </listitem>
183       </varlistentry>
184       <varlistentry>
185         <term>
186           <emphasis remap='I'>pw_dir</emphasis>
187         </term>
188         <listitem>
189           <para>
190             This field is used to define the home directory of the user.
191           </para>
192           <para>
193             If this field does not specify an existing directory, the
194             specified directory is created, with ownership set to the
195             user being created or updated and its primary group.
196           </para>
197           <para>
198             If the home directory of an existing user is changed,
199             <command>newusers</command> does not move or copy the content
200             of the old directory to the new location. This should be done
201             manually.
202           </para>
203         </listitem>
204       </varlistentry>
205       <varlistentry>
206         <term>
207           <emphasis remap='I'>pw_shell</emphasis>
208         </term>
209         <listitem>
210           <para>
211             This field defines the shell of the user.
212             No checks are performed on this field.
213           </para>
214         </listitem>
215       </varlistentry>
216     </variablelist>
217
218     <para>
219       <command>newusers</command> first tries to create or change all the
220       specified users, and then write these changes to the user or group
221       databases. If an error occurs (except in the final writes to the
222       databases), no changes are committed to the databases.
223     </para>
224     <para condition="pam">
225       During this first pass, users are created with a locked password
226       (and passwords are not changed for the users which are not created).
227       A second pass is used to update the passwords using PAM.  Failures
228       to update a password are reported, but will not stop the other
229       password updates.
230     </para>
231
232     <para>
233       This command is intended to be used in a large system environment
234       where many accounts are updated at a single time.
235     </para>
236   </refsect1>
237
238   <refsect1 id='options'>
239     <title>OPTIONS</title>
240     <para>
241       The options which apply to the <command>newusers</command> command are:
242     </para>
243     <variablelist remap='IP' condition="no_pam">
244       <varlistentry>
245         <term><option>-c</option>, <option>--crypt-method</option></term>
246         <listitem>
247           <para>Use the specified method to encrypt the passwords.</para>
248           <para>
249             The available methods are DES, MD5, NONE, and SHA256 or SHA512
250             if your libc support these methods.
251           </para>
252         </listitem>
253       </varlistentry>
254     </variablelist>
255     <variablelist remap='IP'>
256       <varlistentry>
257         <term><option>-h</option>, <option>--help</option></term>
258         <listitem>
259           <para>Display help message and exit.</para>
260         </listitem>
261       </varlistentry>
262       <varlistentry>
263         <term>
264           <option>-r</option>, <option>--system</option>
265         </term>
266         <listitem>
267           <para>
268             Create a system account.
269           </para>
270           <para>
271             System users will be created with no aging information in
272             <filename>/etc/shadow</filename>, and their numeric
273             identifiers are choosen in the
274             <option>SYS_UID_MIN</option>-<option>SYS_UID_MAX</option>
275             range, defined in <filename>login.defs</filename>, instead of
276             <option>UID_MIN</option>-<option>UID_MAX</option> (and their
277             <option>GID</option> counterparts for the creation of groups).
278           </para>
279         </listitem>
280       </varlistentry>
281     </variablelist>
282     <variablelist remap='IP' condition="no_pam">
283       <varlistentry condition="sha_crypt">
284         <term><option>-s</option>, <option>--sha-rounds</option></term>
285         <listitem>
286           <para>
287             Use the specified number of rounds to encrypt the passwords.
288           </para>
289           <para>
290             The value 0 means that the system will choose the default
291             number of rounds for the crypt method (5000).
292           </para>
293           <para>
294             A minimal value of 1000 and a maximal value of 999,999,999
295             will be enforced.
296           </para>
297           <para>
298             You can only use this option with the SHA256 or SHA512
299             crypt method.
300           </para>
301           <para>
302             By default, the number of rounds is defined by the
303             SHA_CRYPT_MIN_ROUNDS and SHA_CRYPT_MAX_ROUNDS variables in
304             <filename>/etc/login.defs</filename>.
305           </para>
306         </listitem>
307       </varlistentry>
308     </variablelist>
309   </refsect1>
310
311   <refsect1 id='caveats'>
312     <title>CAVEATS</title>
313     <para>
314       The input file must be protected since it contains unencrypted
315       passwords.
316     </para>
317     <para condition="no_pam">
318       You should make sure the passwords and the encryption method respect
319       the system's password policy.
320     </para>
321   </refsect1>
322
323   <refsect1 id='configuration'>
324     <title>CONFIGURATION</title>
325     <para>
326       The following configuration variables in
327       <filename>/etc/login.defs</filename> change the behavior of this
328       tool:
329     </para>
330     <variablelist condition="no_pam">
331       &ENCRYPT_METHOD;
332     </variablelist>
333     <variablelist>
334       &GID_MAX; <!-- documents also GID_MIN -->
335       &MAX_MEMBERS_PER_GROUP;
336     </variablelist>
337     <variablelist condition="no_pam">
338       &MD5_CRYPT_ENAB;
339     </variablelist>
340     <variablelist>
341       &PASS_MAX_DAYS;
342       &PASS_MIN_DAYS;
343       &PASS_WARN_AGE;
344     </variablelist>
345     <variablelist condition="no_pam">
346       &SHA_CRYPT_MIN_ROUNDS; <!-- documents also SHA_CRYPT_MAX_ROUNDS-->
347     </variablelist>
348     <variablelist>
349       &SYS_GID_MAX; <!-- documents also SYS_GID_MIN -->
350       &SYS_UID_MAX; <!-- documents also SYS_UID_MIN -->
351       &UID_MAX; <!-- documents also UID_MIN -->
352       &UMASK;
353     </variablelist>
354   </refsect1>
355
356   <refsect1 id='files'>
357     <title>FILES</title>
358     <variablelist>
359       <varlistentry>
360         <term><filename>/etc/passwd</filename></term>
361         <listitem>
362           <para>User account information.</para>
363         </listitem>
364       </varlistentry>
365       <varlistentry>
366         <term><filename>/etc/shadow</filename></term>
367         <listitem>
368           <para>Secure user account information.</para>
369         </listitem>
370       </varlistentry>
371       <varlistentry>
372         <term><filename>/etc/group</filename></term>
373         <listitem>
374           <para>Group account information.</para>
375         </listitem>
376       </varlistentry>
377       <varlistentry condition="gshadow">
378         <term><filename>/etc/gshadow</filename></term>
379         <listitem>
380           <para>Secure group account information.</para>
381         </listitem>
382       </varlistentry>
383       <varlistentry>
384         <term><filename>/etc/login.defs</filename></term>
385         <listitem>
386           <para>Shadow password suite configuration.</para>
387         </listitem>
388       </varlistentry>
389       <varlistentry condition="pam">
390         <term><filename>/etc/pam.d/newusers</filename></term>
391         <listitem>
392           <para>PAM configuration for <command>newusers</command>.</para>
393         </listitem>
394       </varlistentry>
395     </variablelist>
396   </refsect1>
397
398   <refsect1 id='see_also'>
399     <title>SEE ALSO</title>
400     <para>
401       <citerefentry>
402         <refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
403       </citerefentry>,
404       <citerefentry>
405         <refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum>
406       </citerefentry>,
407       <citerefentry>
408         <refentrytitle>useradd</refentrytitle><manvolnum>8</manvolnum>
409       </citerefentry>.
410     </para>
411   </refsect1>
412 </refentry>