Initial commit for Tizen
[profile/extras/shadow-utils.git] / man / groupadd.8.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    Copyright (c) 1991       , 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 GID_MAX               SYSTEM "login.defs.d/GID_MAX.xml">
34 <!ENTITY MAX_MEMBERS_PER_GROUP SYSTEM "login.defs.d/MAX_MEMBERS_PER_GROUP.xml">
35 <!ENTITY SYS_GID_MAX           SYSTEM "login.defs.d/SYS_GID_MAX.xml">
36 <!-- SHADOW-CONFIG-HERE -->
37 ]>
38 <refentry id='groupadd.8'>
39   <!-- $Id: groupadd.8.xml 2964 2009-05-21 12:02:12Z nekral-guest $ -->
40   <refmeta>
41     <refentrytitle>groupadd</refentrytitle>
42     <manvolnum>8</manvolnum>
43     <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
44   </refmeta>
45   <refnamediv id='name'>
46     <refname>groupadd</refname>
47     <refpurpose>create a new group</refpurpose>
48   </refnamediv>
49   <!-- body begins here -->
50   <refsynopsisdiv id='synopsis'>
51     <cmdsynopsis>
52       <command>groupadd</command>
53       <arg choice='opt'>
54         <replaceable>options</replaceable>
55       </arg>
56       <arg choice='plain'>
57         <replaceable>group</replaceable>
58       </arg>
59     </cmdsynopsis>
60   </refsynopsisdiv>
61
62   <refsect1 id='description'>
63     <title>DESCRIPTION</title>
64     <para>The <command>groupadd</command> command creates a new group
65       account using the values specified on the command line plus the default
66       values from the system. The new group will be entered into the system
67       files as needed.
68     </para>
69   </refsect1>
70
71   <refsect1 id='options'>
72     <title>OPTIONS</title>
73     <para>
74       The options which apply to the <command>groupadd</command> command
75       are:
76     </para>
77     <variablelist remap='IP'>
78       <varlistentry>
79         <term>
80           <option>-f</option>, <option>--force</option>
81         </term>
82         <listitem>
83           <para>
84             This option causes the command to simply exit with success
85             status if the specified group already exists. When used with
86             <option>-g</option>, and the specified GID already exists,
87             another (unique) GID is chosen (i.e. <option>-g</option> is
88             turned off).
89           </para>
90         </listitem>
91       </varlistentry>
92       <varlistentry>
93         <term>
94           <option>-g</option>, <option>--gid</option> <replaceable>GID</replaceable>
95         </term>
96         <listitem>
97           <para>The numerical value of the group's ID. This value must be
98             unique, unless the <option>-o</option> option is used. The value
99             must be non-negative. The default is to use the smallest ID
100             value greater than 999 and greater than every other group.
101             Values between 0 and 999 are typically reserved for system
102             accounts.
103           </para>
104         </listitem>
105       </varlistentry>
106       <varlistentry>
107         <term><option>-h</option>, <option>--help</option></term>
108         <listitem>
109           <para>Display help message and exit.</para>
110         </listitem>
111       </varlistentry>
112       <varlistentry>
113         <term>
114           <option>-K</option>, <option>--key</option> <replaceable>KEY</replaceable>=<replaceable>VALUE</replaceable>
115         </term>
116         <listitem>
117           <para>
118             Overrides <filename>/etc/login.defs</filename> defaults 
119             (GID_MIN, GID_MAX and others). Multiple
120             <option>-K</option> options can be specified.
121           </para>
122           <para>
123              Example: <option>-K </option><replaceable>GID_MIN</replaceable>=<replaceable>100</replaceable>
124             <option>-K </option><replaceable>GID_MAX</replaceable>=<replaceable>499</replaceable>
125           </para>
126           <para>
127             Note: <option>-K </option>
128             <replaceable>GID_MIN</replaceable>=<replaceable>10</replaceable>,<replaceable>GID_MAX</replaceable>=<replaceable>499</replaceable>
129             doesn't work yet.
130           </para>
131         </listitem>
132       </varlistentry>
133       <varlistentry>
134         <term>
135           <option>-o</option>, <option>--non-unique</option>
136         </term>
137         <listitem>
138           <para>
139             This option permits to add a group with a non-unique GID.
140           </para>
141         </listitem>
142       </varlistentry>
143       <varlistentry>
144         <term>
145           <option>-p</option>, <option>--password</option>
146           <replaceable>PASSWORD</replaceable>
147         </term>
148         <listitem>
149           <para>
150             The encrypted password, as returned by <citerefentry>
151             <refentrytitle>crypt</refentrytitle><manvolnum>3</manvolnum>
152             </citerefentry>. The default is to disable the password.
153           </para>
154           <para>
155             <emphasis role="bold">Note:</emphasis> This option is not
156             recommended because the password (or encrypted password) will
157             be visible by users listing the processes.
158           </para>
159           <para>
160             You should make sure the password respects the system's
161             password policy.
162           </para>
163         </listitem>
164       </varlistentry>
165       <varlistentry>
166         <term>
167           <option>-r</option>, <option>--system</option>
168         </term>
169         <listitem>
170           <para>
171             Create a system group.
172           </para>
173           <para>
174             The numeric identifiers of new system groups are choosen in
175             the <option>SYS_GID_MIN</option>-<option>SYS_GID_MAX</option>
176             range, defined in <filename>login.defs</filename>, instead of
177             <option>GID_MIN</option>-<option>GID_MAX</option>.
178           </para>
179         </listitem>
180       </varlistentry>
181     </variablelist>
182   </refsect1>
183
184   <refsect1 id='configuration'>
185     <title>CONFIGURATION</title>
186     <para>
187       The following configuration variables in
188       <filename>/etc/login.defs</filename> change the behavior of this
189       tool:
190     </para>
191     <variablelist>
192       &GID_MAX; <!-- documents also GID_MIN -->
193       &MAX_MEMBERS_PER_GROUP;
194       &SYS_GID_MAX; <!-- documents also SYS_GID_MIN -->
195     </variablelist>
196   </refsect1>
197
198   <refsect1 id='files'>
199     <title>FILES</title>
200     <variablelist>
201       <varlistentry>
202         <term><filename>/etc/group</filename></term>
203         <listitem>
204           <para>Group account information.</para>
205         </listitem>
206       </varlistentry>
207       <varlistentry condition="gshadow">
208         <term><filename>/etc/gshadow</filename></term>
209         <listitem>
210           <para>Secure group account information.</para>
211         </listitem>
212       </varlistentry>
213       <varlistentry>
214         <term><filename>/etc/login.defs</filename></term>
215         <listitem>
216           <para>Shadow password suite configuration.</para>
217         </listitem>
218       </varlistentry>
219     </variablelist>
220   </refsect1>
221
222    <refsect1 id='caveats'>
223      <title>CAVEATS</title>
224      <para>
225        Groupnames must start with a lower case letter or an underscore,
226        followed by lower case letters, digits, underscores, or dashes.
227        They can end with a dollar sign.
228        In regular expression terms: [a-z_][a-z0-9_-]*[$]?
229      </para>
230      <para>
231        Groupnames may only be up to &GROUP_NAME_MAX_LENGTH; characters long.
232      </para>
233      <para>
234        You may not add a NIS or LDAP group. This must be performed on the
235        corresponding server.
236      </para>
237      <para>
238        If the groupname already exists in an external group database such
239        as NIS or LDAP, <command>groupadd</command> will deny the group
240        creation request.
241      </para>
242    </refsect1>
243
244   <refsect1 id='exit_values'>
245     <title>EXIT VALUES</title>
246     <para>
247       The <command>groupadd</command> command exits with the following values:
248       <variablelist>
249         <varlistentry>
250           <term><replaceable>0</replaceable></term>
251           <listitem>
252             <para>success</para>
253           </listitem>
254         </varlistentry>
255         <varlistentry>
256           <term><replaceable>2</replaceable></term>
257           <listitem>
258             <para>invalid command syntax</para>
259           </listitem>
260         </varlistentry>
261         <varlistentry>
262           <term><replaceable>3</replaceable></term>
263           <listitem>
264             <para>invalid argument to option</para>
265           </listitem>
266         </varlistentry>
267         <varlistentry>
268           <term><replaceable>4</replaceable></term>
269           <listitem>
270             <para>GID not unique (when <option>-o</option> not used)</para>
271           </listitem>
272         </varlistentry>
273         <varlistentry>
274           <term><replaceable>9</replaceable></term>
275           <listitem>
276             <para>group name not unique</para>
277           </listitem>
278         </varlistentry>
279         <varlistentry>
280           <term><replaceable>10</replaceable></term>
281           <listitem>
282             <para>can't update group file</para>
283           </listitem>
284         </varlistentry>
285       </variablelist>
286     </para>
287   </refsect1>
288
289   <refsect1 id='see_also'>
290     <title>SEE ALSO</title>
291     <para><citerefentry>
292         <refentrytitle>chfn</refentrytitle><manvolnum>1</manvolnum>
293       </citerefentry>,
294       <citerefentry>
295         <refentrytitle>chsh</refentrytitle><manvolnum>1</manvolnum>
296       </citerefentry>,
297       <citerefentry>
298         <refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum>
299       </citerefentry>,
300       <citerefentry>
301         <refentrytitle>gpasswd</refentrytitle><manvolnum>8</manvolnum>
302       </citerefentry>,
303       <citerefentry>
304         <refentrytitle>groupdel</refentrytitle><manvolnum>8</manvolnum>
305       </citerefentry>,
306       <citerefentry>
307         <refentrytitle>groupmod</refentrytitle><manvolnum>8</manvolnum>
308       </citerefentry>,
309       <citerefentry>
310         <refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
311       </citerefentry>,
312       <citerefentry>
313         <refentrytitle>useradd</refentrytitle><manvolnum>8</manvolnum>
314       </citerefentry>,
315       <citerefentry>
316         <refentrytitle>userdel</refentrytitle><manvolnum>8</manvolnum>
317       </citerefentry>,
318       <citerefentry>
319         <refentrytitle>usermod</refentrytitle><manvolnum>8</manvolnum>
320       </citerefentry>.
321     </para>
322   </refsect1>
323 </refentry>