]> granicus.if.org Git - shadow/blob - man/usermod.8.xml
[svn-upgrade] Integrating new upstream version, shadow (4.0.16)
[shadow] / man / usermod.8.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry id='usermod.8'>
3   <!--  $Id: usermod.8.xml,v 1.25 2006/05/20 12:11:38 kloczek Exp $  -->
4   <refmeta>
5     <refentrytitle>usermod</refentrytitle>
6     <manvolnum>8</manvolnum>
7     <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
8   </refmeta>
9   <refnamediv id='name'>
10     <refname>usermod</refname>
11     <refpurpose>modify a user account</refpurpose>
12   </refnamediv>
13
14   <refsynopsisdiv id='synopsis'>
15     <cmdsynopsis>
16       <command>usermod</command>
17       <arg choice='opt'>
18         <replaceable>options</replaceable>
19       </arg>
20       <arg choice='plain'><replaceable>LOGIN</replaceable></arg>
21     </cmdsynopsis>
22   </refsynopsisdiv>
23
24   <refsect1 id='description'>
25     <title>DESCRIPTION</title>
26     <para>
27       The <command>usermod</command> command modifies the system account
28       files to reflect the changes that are specified on the command line.
29     </para>
30   </refsect1>
31
32   <refsect1 id='options'>
33     <title>OPTIONS</title>
34     <para>
35       The options which apply to the <command>usermod</command> command
36       are:
37     </para>
38     <variablelist remap='IP'>
39       <varlistentry>
40         <term>
41           <option>-a</option>, <option>--append</option>
42           <replaceable>GROUP</replaceable>
43         </term>
44         <listitem>
45           <para>
46             Add the user to the supplemental group.
47           </para>
48         </listitem>
49       </varlistentry>
50       <varlistentry>
51         <term>
52           <option>-c</option>, <option>--comment</option>
53           <replaceable>COMMENT</replaceable>
54         </term>
55         <listitem>
56           <para>
57             The new value of the user's password file comment field. It is
58             normally modified using the <citerefentry>
59             <refentrytitle>chfn</refentrytitle><manvolnum>1</manvolnum>
60             </citerefentry> utility.
61           </para>
62         </listitem>
63       </varlistentry>
64       <varlistentry>
65         <term>
66           <option>-d</option>, <option>--home</option>
67           <replaceable>HOME_DIR</replaceable>
68         </term>
69         <listitem>
70           <para>
71             The user's new login directory. If the <option>-m</option>
72             option is given the contents of the current home directory will
73             be moved to the new home directory, which is created if it does
74             not already exist.
75           </para>
76         </listitem>
77       </varlistentry>
78       <varlistentry>
79         <term>
80           <option>-e</option>, <option>--expiredate</option>
81           <replaceable>EXPIRE_DATE</replaceable>
82         </term>
83         <listitem>
84           <para>
85             The date on which the user account will be disabled. The date is
86             specified in the format <emphasis remap='I'>YYYY-MM-DD</emphasis>.
87           </para>
88         </listitem>
89       </varlistentry>
90       <varlistentry>
91         <term>
92           <option>-f</option>, <option>--inactive</option>
93           <replaceable>INACTIVE</replaceable>
94         </term>
95         <listitem>
96           <para>
97             The number of days after a password expires until the account is
98             permanently disabled. A value of 0 disables the account as soon
99             as the password has expired, and a value of -1 disables the
100             feature. The default value is -1.
101           </para>
102         </listitem>
103       </varlistentry>
104       <varlistentry>
105         <term>
106           <option>-g</option>, <option>--gid</option>
107           <replaceable>GROUP</replaceable>
108         </term>
109         <listitem>
110           <para>
111             The group name or number of the user's new initial login group.
112             The group name must exist. A group number must refer to an
113             already existing group. The default group number is 1.
114           </para>
115         </listitem>
116       </varlistentry>
117       <varlistentry>
118         <term>
119           <option>-G</option>, <option>--groups</option>
120           <replaceable>GROUP1</replaceable>[<emphasis remap='I'>,GROUP2,...</emphasis>[<emphasis remap='I'>,GROUPN</emphasis>]]]
121         </term>
122         <listitem>
123           <para>
124             A list of supplementary groups which the user is also a member
125             of. Each group is separated from the next by a comma, with no
126             intervening whitespace. The groups are subject to the same
127             restrictions as the group given with the <option>-g</option>
128             option. If the user is currently a member of a group which is
129             not listed, the user will be removed from the group. This
130             behaviour can be changed via <option>-a</option> option, which
131             appends user to the current supplementary group list.
132           </para>
133         </listitem>
134       </varlistentry>
135       <varlistentry>
136         <term>
137           <option>-l</option>, <option>--login</option>
138           <replaceable>NEW_LOGIN</replaceable>
139         </term>
140         <listitem>
141           <para>
142             The name of the user will be changed from <emphasis
143             remap='I'>LOGIN</emphasis> to <emphasis
144             remap='I'>NEW_LOGIN</emphasis>. Nothing else is changed. In
145             particular, the user's home directory name should probably be
146             changed to reflect the new login name.
147           </para>
148         </listitem>
149       </varlistentry>
150       <varlistentry>
151         <term>
152           <option>-L</option>, <option>--lock</option>
153         </term>
154         <listitem>
155           <para>
156             Lock a user's password. This puts a '!' in front of the
157             encrypted password, effectively disabling the password. You
158             can't use this option with <option>-p</option> or
159             <option>-U</option>.
160           </para>
161         </listitem>
162       </varlistentry>
163       <varlistentry>
164         <term>
165           <option>-o</option>, <option>--non-unique</option>
166         </term>
167         <listitem>
168           <para>
169             When used with the <option>-u</option> option, this option
170             allows to change the user ID to a non-unique value.
171           </para>
172         </listitem>
173       </varlistentry>
174       <varlistentry>
175         <term>
176           <option>-p</option>, <option>--password</option>
177           <replaceable>PASSWORD</replaceable>
178         </term>
179         <listitem>
180           <para>
181             The encrypted password, as returned by <citerefentry>
182             <refentrytitle>crypt</refentrytitle><manvolnum>3</manvolnum>
183             </citerefentry>.
184           </para>
185         </listitem>
186       </varlistentry>
187       <varlistentry>
188         <term>
189           <option>-s</option>, <option>--shell</option>
190           <replaceable>SHELL</replaceable>
191         </term>
192         <listitem>
193           <para>
194             The name of the user's new login shell. Setting this field to
195             blank causes the system to select the default login shell.
196           </para>
197         </listitem>
198       </varlistentry>
199       <varlistentry>
200         <term>
201           <option>-u</option>, <option>--uid</option>
202           <replaceable>UID</replaceable>
203         </term>
204         <listitem>
205           <para>
206             The numerical value of the user's ID. This value must be unique,
207             unless the <option>-o</option> option is used. The value must be
208             non-negative. Values between 0 and 999 are typically reserved
209             for system accounts. Any files which the user owns and which are
210             located in the directory tree rooted at the user's home
211             directory will have the file user ID changed automatically. 
212             Files outside of the user's home directory must be altered
213             manually.
214           </para>
215         </listitem>
216       </varlistentry>
217       <varlistentry>
218         <term>
219           <option>-U</option>, <option>--unlock</option>
220         </term>
221         <listitem>
222           <para>
223             Unlock a user's password. This removes the '!' in front of the
224             encrypted password. You can't use this option with
225             <option>-p</option> or <option>-L</option>.
226           </para>
227         </listitem>
228       </varlistentry>
229     </variablelist>
230   </refsect1>
231
232   <refsect1 id='caveats'>
233     <title>CAVEATS</title>
234     <para>
235       <command>usermod</command> will not allow you to change the name of a
236       user who is logged in. You must make certain that the named user is
237       not executing any processes when this command is being executed if the
238       user's numerical user ID is being changed. You must change the owner
239       of any crontab files manually. You must change the owner of any at
240       jobs manually. You must make any changes involving NIS on the NIS
241       server.
242     </para>
243   </refsect1>
244
245   <refsect1 id='files'>
246     <title>FILES</title>
247     <variablelist>
248       <varlistentry>
249         <term><filename>/etc/group</filename></term>
250         <listitem>
251           <para>Group account information.</para>
252         </listitem>
253       </varlistentry>
254       <varlistentry>
255         <term><filename>/etc/login.defs</filename></term>
256         <listitem>
257           <para>Shadow password suite configuration.</para>
258         </listitem>
259       </varlistentry>
260       <varlistentry>
261         <term><filename>/etc/passwd</filename></term>
262         <listitem>
263           <para>User account information.</para>
264         </listitem>
265       </varlistentry>
266       <varlistentry>
267         <term><filename>/etc/shadow</filename></term>
268         <listitem>
269           <para>Secure user account information.</para>
270         </listitem>
271       </varlistentry>
272     </variablelist>
273   </refsect1>
274
275   <refsect1 id='see_also'>
276     <title>SEE ALSO</title>
277     <para>
278       <citerefentry>
279         <refentrytitle>chfn</refentrytitle><manvolnum>1</manvolnum>
280       </citerefentry>,
281       <citerefentry>
282         <refentrytitle>chsh</refentrytitle><manvolnum>1</manvolnum>
283       </citerefentry>,
284       <citerefentry>
285         <refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum>
286       </citerefentry>,
287       <citerefentry>
288         <refentrytitle>crypt</refentrytitle><manvolnum>3</manvolnum>
289       </citerefentry>,
290       <citerefentry>
291         <refentrytitle>gpasswd</refentrytitle><manvolnum>8</manvolnum>
292       </citerefentry>,
293       <citerefentry>
294         <refentrytitle>groupadd</refentrytitle><manvolnum>8</manvolnum>
295       </citerefentry>,
296       <citerefentry>
297         <refentrytitle>groupdel</refentrytitle><manvolnum>8</manvolnum>
298       </citerefentry>,
299       <citerefentry>
300         <refentrytitle>groupmod</refentrytitle><manvolnum>8</manvolnum>
301       </citerefentry>,
302       <citerefentry>
303         <refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
304       </citerefentry>,
305       <citerefentry>
306         <refentrytitle>useradd</refentrytitle><manvolnum>8</manvolnum>
307       </citerefentry>,
308       <citerefentry>
309         <refentrytitle>userdel</refentrytitle><manvolnum>8</manvolnum>
310       </citerefentry>.
311     </para>
312   </refsect1>
313 </refentry>