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 $ -->
5 <refentrytitle>usermod</refentrytitle>
6 <manvolnum>8</manvolnum>
7 <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
10 <refname>usermod</refname>
11 <refpurpose>modify a user account</refpurpose>
14 <refsynopsisdiv id='synopsis'>
16 <command>usermod</command>
18 <replaceable>options</replaceable>
20 <arg choice='plain'><replaceable>LOGIN</replaceable></arg>
24 <refsect1 id='description'>
25 <title>DESCRIPTION</title>
27 The <command>usermod</command> command modifies the system account
28 files to reflect the changes that are specified on the command line.
32 <refsect1 id='options'>
33 <title>OPTIONS</title>
35 The options which apply to the <command>usermod</command> command
38 <variablelist remap='IP'>
41 <option>-a</option>, <option>--append</option>
42 <replaceable>GROUP</replaceable>
46 Add the user to the supplemental group.
52 <option>-c</option>, <option>--comment</option>
53 <replaceable>COMMENT</replaceable>
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.
66 <option>-d</option>, <option>--home</option>
67 <replaceable>HOME_DIR</replaceable>
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
80 <option>-e</option>, <option>--expiredate</option>
81 <replaceable>EXPIRE_DATE</replaceable>
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>.
92 <option>-f</option>, <option>--inactive</option>
93 <replaceable>INACTIVE</replaceable>
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.
106 <option>-g</option>, <option>--gid</option>
107 <replaceable>GROUP</replaceable>
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.
119 <option>-G</option>, <option>--groups</option>
120 <replaceable>GROUP1</replaceable>[<emphasis remap='I'>,GROUP2,...</emphasis>[<emphasis remap='I'>,GROUPN</emphasis>]]]
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.
137 <option>-l</option>, <option>--login</option>
138 <replaceable>NEW_LOGIN</replaceable>
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.
152 <option>-L</option>, <option>--lock</option>
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
165 <option>-o</option>, <option>--non-unique</option>
169 When used with the <option>-u</option> option, this option
170 allows to change the user ID to a non-unique value.
176 <option>-p</option>, <option>--password</option>
177 <replaceable>PASSWORD</replaceable>
181 The encrypted password, as returned by <citerefentry>
182 <refentrytitle>crypt</refentrytitle><manvolnum>3</manvolnum>
189 <option>-s</option>, <option>--shell</option>
190 <replaceable>SHELL</replaceable>
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.
201 <option>-u</option>, <option>--uid</option>
202 <replaceable>UID</replaceable>
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
219 <option>-U</option>, <option>--unlock</option>
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>.
232 <refsect1 id='caveats'>
233 <title>CAVEATS</title>
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
245 <refsect1 id='files'>
249 <term><filename>/etc/group</filename></term>
251 <para>Group account information.</para>
255 <term><filename>/etc/login.defs</filename></term>
257 <para>Shadow password suite configuration.</para>
261 <term><filename>/etc/passwd</filename></term>
263 <para>User account information.</para>
267 <term><filename>/etc/shadow</filename></term>
269 <para>Secure user account information.</para>
275 <refsect1 id='see_also'>
276 <title>SEE ALSO</title>
279 <refentrytitle>chfn</refentrytitle><manvolnum>1</manvolnum>
282 <refentrytitle>chsh</refentrytitle><manvolnum>1</manvolnum>
285 <refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum>
288 <refentrytitle>crypt</refentrytitle><manvolnum>3</manvolnum>
291 <refentrytitle>gpasswd</refentrytitle><manvolnum>8</manvolnum>
294 <refentrytitle>groupadd</refentrytitle><manvolnum>8</manvolnum>
297 <refentrytitle>groupdel</refentrytitle><manvolnum>8</manvolnum>
300 <refentrytitle>groupmod</refentrytitle><manvolnum>8</manvolnum>
303 <refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
306 <refentrytitle>useradd</refentrytitle><manvolnum>8</manvolnum>
309 <refentrytitle>userdel</refentrytitle><manvolnum>8</manvolnum>