Initial commit for Tizen
[profile/extras/shadow-utils.git] / man / usermod.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 MAIL_DIR              SYSTEM "login.defs.d/MAIL_DIR.xml">
34 <!ENTITY MAX_MEMBERS_PER_GROUP SYSTEM "login.defs.d/MAX_MEMBERS_PER_GROUP.xml">
35 ]>
36 <refentry id='usermod.8'>
37   <!--  $Id: usermod.8.xml 2964 2009-05-21 12:02:12Z nekral-guest $  -->
38   <refmeta>
39     <refentrytitle>usermod</refentrytitle>
40     <manvolnum>8</manvolnum>
41     <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
42   </refmeta>
43   <refnamediv id='name'>
44     <refname>usermod</refname>
45     <refpurpose>modify a user account</refpurpose>
46   </refnamediv>
47
48   <refsynopsisdiv id='synopsis'>
49     <cmdsynopsis>
50       <command>usermod</command>
51       <arg choice='opt'>
52         <replaceable>options</replaceable>
53       </arg>
54       <arg choice='plain'><replaceable>LOGIN</replaceable></arg>
55     </cmdsynopsis>
56   </refsynopsisdiv>
57
58   <refsect1 id='description'>
59     <title>DESCRIPTION</title>
60     <para>
61       The <command>usermod</command> command modifies the system account
62       files to reflect the changes that are specified on the command line.
63     </para>
64   </refsect1>
65
66   <refsect1 id='options'>
67     <title>OPTIONS</title>
68     <para>
69       The options which apply to the <command>usermod</command> command
70       are:
71     </para>
72     <variablelist>
73       <varlistentry>
74         <term>
75           <option>-a</option>, <option>--append</option>
76         </term>
77         <listitem>
78           <para>
79             Add the user to the supplementary group(s). Use only with the
80             <option>-G</option> option.
81           </para>
82         </listitem>
83       </varlistentry>
84       <varlistentry>
85         <term>
86           <option>-c</option>, <option>--comment</option>
87           <replaceable>COMMENT</replaceable>
88         </term>
89         <listitem>
90           <para>
91             The new value of the user's password file comment field. It is
92             normally modified using the <citerefentry>
93             <refentrytitle>chfn</refentrytitle><manvolnum>1</manvolnum>
94             </citerefentry> utility.
95           </para>
96         </listitem>
97       </varlistentry>
98       <varlistentry>
99         <term>
100           <option>-d</option>, <option>--home</option>
101           <replaceable>HOME_DIR</replaceable>
102         </term>
103         <listitem>
104           <para>
105             The user's new login directory.
106           </para>
107           <para>
108             If the <option>-m</option>
109             option is given, the contents of the current home directory will
110             be moved to the new home directory, which is created if it does
111             not already exist.
112           </para>
113         </listitem>
114       </varlistentry>
115       <varlistentry>
116         <term>
117           <option>-e</option>, <option>--expiredate</option>
118           <replaceable>EXPIRE_DATE</replaceable>
119         </term>
120         <listitem>
121           <para>
122             The date on which the user account will be disabled. The date is
123             specified in the format <emphasis remap='I'>YYYY-MM-DD</emphasis>.
124           </para>
125         </listitem>
126       </varlistentry>
127       <varlistentry>
128         <term>
129           <option>-f</option>, <option>--inactive</option>
130           <replaceable>INACTIVE</replaceable>
131         </term>
132         <listitem>
133           <para>
134             The number of days after a password expires until the account is
135             permanently disabled.
136           </para>
137           <para>
138             A value of 0 disables the account as soon
139             as the password has expired, and a value of -1 disables the
140             feature.
141           </para>
142         </listitem>
143       </varlistentry>
144       <varlistentry>
145         <term>
146           <option>-g</option>, <option>--gid</option>
147           <replaceable>GROUP</replaceable>
148         </term>
149         <listitem>
150           <para>
151             The group name or number of the user's new initial login group.
152             The group must exist.
153           </para>
154         </listitem>
155       </varlistentry>
156       <varlistentry>
157         <term>
158           <option>-G</option>, <option>--groups</option>
159           <replaceable>GROUP1</replaceable>[<emphasis remap='I'>,GROUP2,...</emphasis>[<emphasis remap='I'>,GROUPN</emphasis>]]]
160         </term>
161         <listitem>
162           <para>
163             A list of supplementary groups which the user is also a member
164             of. Each group is separated from the next by a comma, with no
165             intervening whitespace. The groups are subject to the same
166             restrictions as the group given with the <option>-g</option>
167             option.
168           </para>
169           <para>
170             If the user is currently a member of a group which is
171             not listed, the user will be removed from the group. This
172             behaviour can be changed via the <option>-a</option> option, which
173             appends the user to the current supplementary group list.
174           </para>
175         </listitem>
176       </varlistentry>
177       <varlistentry>
178         <term>
179           <option>-l</option>, <option>--login</option>
180           <replaceable>NEW_LOGIN</replaceable>
181         </term>
182         <listitem>
183           <para>
184             The name of the user will be changed from
185             <replaceable>LOGIN</replaceable> to
186             <replaceable>NEW_LOGIN</replaceable>. Nothing else is changed. In
187             particular, the user's home directory name should probably be
188             changed manually to reflect the new login name.
189           </para>
190         </listitem>
191       </varlistentry>
192       <varlistentry>
193         <term>
194           <option>-L</option>, <option>--lock</option>
195         </term>
196         <listitem>
197           <para>
198             Lock a user's password. This puts a '!' in front of the
199             encrypted password, effectively disabling the password. You
200             can't use this option with <option>-p</option> or
201             <option>-U</option>.
202           </para>
203           <para>
204             Note: if you wish to lock the account (not only access with a
205             password), you should also set the
206             <replaceable>EXPIRE_DATE</replaceable> to
207             <replaceable>1</replaceable>.
208           </para>
209         </listitem>
210       </varlistentry>
211       <varlistentry>
212         <term>
213           <option>-m</option>, <option>--move-home</option>
214         </term>
215         <listitem>
216           <para>
217             Move the content of the user's home directory to the new
218             location.
219           </para>
220           <para>
221             This option is only valid in combination with the
222             <option>-d</option> (or <option>--home</option>) option.
223           </para>
224         </listitem>
225       </varlistentry>
226       <varlistentry>
227         <term>
228           <option>-o</option>, <option>--non-unique</option>
229         </term>
230         <listitem>
231           <para>
232             When used with the <option>-u</option> option, this option
233             allows to change the user ID to a non-unique value.
234           </para>
235         </listitem>
236       </varlistentry>
237       <varlistentry>
238         <term>
239           <option>-p</option>, <option>--password</option>
240           <replaceable>PASSWORD</replaceable>
241         </term>
242         <listitem>
243           <para>
244             The encrypted password, as returned by <citerefentry>
245             <refentrytitle>crypt</refentrytitle><manvolnum>3</manvolnum>
246             </citerefentry>.
247           </para>
248           <para>
249             <emphasis role="bold">Note:</emphasis> This option is not
250             recommended because the password (or encrypted password) will
251             be visible by users listing the processes.
252           </para>
253           <para condition="pam">
254             The password will be written in the local
255             <filename>/etc/passwd</filename> or
256             <filename>/etc/shadow</filename> file. This might differ from the
257             password database configured in your PAM configuration.
258           </para>
259           <para>
260             You should make sure the password respects the system's
261             password policy.
262           </para>
263         </listitem>
264       </varlistentry>
265       <varlistentry>
266         <term>
267           <option>-s</option>, <option>--shell</option>
268           <replaceable>SHELL</replaceable>
269         </term>
270         <listitem>
271           <para>
272             The name of the user's new login shell. Setting this field to
273             blank causes the system to select the default login shell.
274           </para>
275         </listitem>
276       </varlistentry>
277       <varlistentry>
278         <term>
279           <option>-u</option>, <option>--uid</option>
280           <replaceable>UID</replaceable>
281         </term>
282         <listitem>
283           <para>
284             The new numerical value of the user's ID.
285           </para>
286           <para>
287             This value must be unique,
288             unless the <option>-o</option> option is used. The value must be
289             non-negative. Values between 0 and 999 are typically reserved
290             for system accounts.
291           </para>
292           <para>
293             The user's mailbox, and any files which the user owns and which are
294             located in the user's home
295             directory will have the file user ID changed automatically.
296           </para>
297           <para>
298             The ownership of files outside of the user's home directory
299             must be fixed manually.
300           </para>
301         </listitem>
302       </varlistentry>
303       <varlistentry>
304         <term>
305           <option>-U</option>, <option>--unlock</option>
306         </term>
307         <listitem>
308           <para>
309             Unlock a user's password. This removes the '!' in front of the
310             encrypted password. You can't use this option with
311             <option>-p</option> or <option>-L</option>.
312           </para>
313           <para>
314             Note: if you wish to unlock the account (not only access with a
315             password), you should also set the
316             <replaceable>EXPIRE_DATE</replaceable> (for example to
317             <replaceable>99999</replaceable>, or to the
318             <option>EXPIRE</option> value from
319             <filename>/etc/default/useradd</filename>).
320           </para>
321         </listitem>
322       </varlistentry>
323         <varlistentry>
324           <term>
325             <option>-Z</option>, <option>--selinux-user</option>
326             <replaceable>SEUSER</replaceable>
327           </term>
328           <listitem>
329             <para>
330               The SELinux user for the user's login. The default is to leave
331               this field the blank, which causes the system to select the
332               default SELinux user.
333             </para>
334           </listitem>
335         </varlistentry>
336     </variablelist>
337   </refsect1>
338
339   <refsect1 id='caveats'>
340     <title>CAVEATS</title>
341     <para>
342       You must make certain that the named user is
343       not executing any processes when this command is being executed if the
344       user's numerical user ID, the user's name, or the user's home
345       directory is being changed. <command>usermod</command> checks this
346       on Linux, but only check if the user is logged in according to utmp
347       on other architectures.
348     </para>
349     <para>
350       You must change the owner of any <command>crontab</command> files or
351       <command>at</command> jobs manually.
352     </para>
353     <para>
354       You must make any changes involving NIS on the NIS server.
355     </para>
356   </refsect1>
357
358   <refsect1 id='configuration'>
359     <title>CONFIGURATION</title>
360     <para>
361       The following configuration variables in
362       <filename>/etc/login.defs</filename> change the behavior of this
363       tool:
364     </para>
365     <variablelist>
366       &MAIL_DIR; <!-- documents also MAIL_FILE -->
367       &MAX_MEMBERS_PER_GROUP;
368     </variablelist>
369   </refsect1>
370
371   <refsect1 id='files'>
372     <title>FILES</title>
373     <variablelist>
374       <varlistentry>
375         <term><filename>/etc/group</filename></term>
376         <listitem>
377           <para>Group account information.</para>
378         </listitem>
379       </varlistentry>
380       <varlistentry condition="gshadow">
381         <term><filename>/etc/gshadow</filename></term>
382         <listitem>
383           <para>Secure group account information.</para>
384         </listitem>
385       </varlistentry>
386       <varlistentry>
387         <term><filename>/etc/passwd</filename></term>
388         <listitem>
389           <para>User account information.</para>
390         </listitem>
391       </varlistentry>
392       <varlistentry>
393         <term><filename>/etc/shadow</filename></term>
394         <listitem>
395           <para>Secure user account information.</para>
396         </listitem>
397       </varlistentry>
398     </variablelist>
399   </refsect1>
400
401   <refsect1 id='see_also'>
402     <title>SEE ALSO</title>
403     <para>
404       <citerefentry>
405         <refentrytitle>chfn</refentrytitle><manvolnum>1</manvolnum>
406       </citerefentry>,
407       <citerefentry>
408         <refentrytitle>chsh</refentrytitle><manvolnum>1</manvolnum>
409       </citerefentry>,
410       <citerefentry>
411         <refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum>
412       </citerefentry>,
413       <citerefentry>
414         <refentrytitle>crypt</refentrytitle><manvolnum>3</manvolnum>
415       </citerefentry>,
416       <citerefentry>
417         <refentrytitle>gpasswd</refentrytitle><manvolnum>8</manvolnum>
418       </citerefentry>,
419       <citerefentry>
420         <refentrytitle>groupadd</refentrytitle><manvolnum>8</manvolnum>
421       </citerefentry>,
422       <citerefentry>
423         <refentrytitle>groupdel</refentrytitle><manvolnum>8</manvolnum>
424       </citerefentry>,
425       <citerefentry>
426         <refentrytitle>groupmod</refentrytitle><manvolnum>8</manvolnum>
427       </citerefentry>,
428       <citerefentry>
429         <refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
430       </citerefentry>,
431       <citerefentry>
432         <refentrytitle>useradd</refentrytitle><manvolnum>8</manvolnum>
433       </citerefentry>,
434       <citerefentry>
435         <refentrytitle>userdel</refentrytitle><manvolnum>8</manvolnum>
436       </citerefentry>.
437     </para>
438   </refsect1>
439 </refentry>