2007-10-07 17:17:33 +05:30
. \" Title: usermod
. \" Author:
. \" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
2007-10-07 17:17:45 +05:30
. \" Date: 06/24/2006
2007-10-07 17:17:33 +05:30
. \" Manual: System Management Commands
. \" Source: System Management Commands
. \"
2007-10-07 17:17:45 +05:30
.TH "USERMOD" "8" "06/24/2006" "System Management Commands" "System Management Commands"
2007-10-07 17:16:52 +05:30
. \" disable hyphenation
.nh
. \" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
2007-10-07 17:17:33 +05:30
usermod \- modify a user account
2007-10-07 17:16:25 +05:30
.SH "SYNOPSIS"
.HP 8
2007-10-07 17:17:11 +05:30
\fB usermod\fR [\fI options\fR ] \fI LOGIN\fR
2007-10-07 17:16:25 +05:30
.SH "DESCRIPTION"
.PP
2007-10-07 17:17:01 +05:30
The
\fB usermod\fR
2007-10-07 17:16:52 +05:30
command modifies the system account files to reflect the changes that are specified on the command line.
2007-10-07 17:16:25 +05:30
.SH "OPTIONS"
.PP
2007-10-07 17:17:01 +05:30
The options which apply to the
\fB usermod\fR
2007-10-07 17:16:52 +05:30
command are:
2007-10-07 17:17:33 +05:30
.TP 3 n
\fB \- a\fR , \fB \- \- append\fR \fI GROUP\fR
Add the user to the supplemental group.
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- c\fR , \fB \- \- comment\fR \fI COMMENT\fR
2007-10-07 17:17:01 +05:30
The new value of the user's password file comment field. It is normally modified using the
\fB chfn\fR (1)
utility.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- d\fR , \fB \- \- home\fR \fI HOME_DIR\fR
2007-10-07 17:17:01 +05:30
The user's new login directory. If the
\fB \- m\fR
2007-10-07 17:16:52 +05:30
option is given the contents of the current home directory will be moved to the new home directory, which is created if it does not already exist.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- e\fR , \fB \- \- expiredate\fR \fI EXPIRE_DATE\fR
2007-10-07 17:17:01 +05:30
The date on which the user account will be disabled. The date is specified in the format
2007-10-07 17:17:11 +05:30
\fI YYYY\- MM\- DD\fR .
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- f\fR , \fB \- \- inactive\fR \fI INACTIVE\fR
2007-10-07 17:16:52 +05:30
The number of days after a password expires until the account is permanently disabled. A value of 0 disables the account as soon as the password has expired, and a value of \- 1 disables the feature. The default value is \- 1.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- g\fR , \fB \- \- gid\fR \fI GROUP\fR
2007-10-07 17:16:52 +05:30
The group name or number of the user's new initial login group. The group name must exist. A group number must refer to an already existing group. The default group number is 1.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- G\fR , \fB \- \- groups\fR \fI GROUP1\fR [\fI ,GROUP2,...\fR [\fI ,GROUPN\fR ]]]
2007-10-07 17:17:01 +05:30
A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace. The groups are subject to the same restrictions as the group given with the
\fB \- g\fR
option. If the user is currently a member of a group which is not listed, the user will be removed from the group. This behaviour can be changed via
\fB \- a\fR
2007-10-07 17:16:52 +05:30
option, which appends user to the current supplementary group list.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- l\fR , \fB \- \- login\fR \fI NEW_LOGIN\fR
2007-10-07 17:17:01 +05:30
The name of the user will be changed from
2007-10-07 17:17:11 +05:30
\fI LOGIN\fR
2007-10-07 17:17:01 +05:30
to
2007-10-07 17:17:11 +05:30
\fI NEW_LOGIN\fR . Nothing else is changed. In particular, the user's home directory name should probably be changed to reflect the new login name.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- L\fR , \fB \- \- lock\fR
2007-10-07 17:17:01 +05:30
Lock a user's password. This puts a '!' in front of the encrypted password, effectively disabling the password. You can't use this option with
\fB \- p\fR
or
2007-10-07 17:16:52 +05:30
\fB \- U\fR .
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- o\fR , \fB \- \- non\- unique\fR
2007-10-07 17:17:01 +05:30
When used with the
\fB \- u\fR
2007-10-07 17:16:52 +05:30
option, this option allows to change the user ID to a non\- unique value.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- p\fR , \fB \- \- password\fR \fI PASSWORD\fR
2007-10-07 17:17:01 +05:30
The encrypted password, as returned by
2007-10-07 17:16:52 +05:30
\fB crypt\fR (3).
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- s\fR , \fB \- \- shell\fR \fI SHELL\fR
2007-10-07 17:16:52 +05:30
The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- u\fR , \fB \- \- uid\fR \fI UID\fR
2007-10-07 17:17:01 +05:30
The numerical value of the user's ID. This value must be unique, unless the
\fB \- o\fR
2007-10-07 17:16:52 +05:30
option is used. The value must be non\- negative. Values between 0 and 999 are typically reserved for system accounts. Any files which the user owns and which are located in the directory tree rooted at the user's home directory will have the file user ID changed automatically. Files outside of the user's home directory must be altered manually.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:11 +05:30
\fB \- U\fR , \fB \- \- unlock\fR
2007-10-07 17:17:01 +05:30
Unlock a user's password. This removes the '!' in front of the encrypted password. You can't use this option with
\fB \- p\fR
or
2007-10-07 17:16:52 +05:30
\fB \- L\fR .
2007-10-07 17:16:25 +05:30
.SH "CAVEATS"
.PP
2007-10-07 17:17:33 +05:30
2007-10-07 17:17:01 +05:30
\fB usermod\fR
2007-10-07 17:17:45 +05:30
will not allow you to change the name of a user who is logged in. You must make certain that the named user is not executing any processes when this command is being executed if the user's numerical user ID is being changed. You must change the owner of any
\fB crontab\fR
files manually. You must change the owner of any
\fB at\fR
jobs manually. You must make any changes involving NIS on the NIS server.
2007-10-07 17:16:25 +05:30
.SH "FILES"
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:01 +05:30
\fI /etc/group\fR
2007-10-07 17:17:33 +05:30
Group account information.
.TP 3 n
2007-10-07 17:16:25 +05:30
\fI /etc/passwd\fR
2007-10-07 17:17:33 +05:30
User account information.
.TP 3 n
2007-10-07 17:16:25 +05:30
\fI /etc/shadow\fR
2007-10-07 17:17:33 +05:30
Secure user account information.
2007-10-07 17:16:25 +05:30
.SH "SEE ALSO"
.PP
2007-10-07 17:17:33 +05:30
2007-10-07 17:17:01 +05:30
\fB chfn\fR (1),
\fB chsh\fR (1),
\fB passwd\fR (1),
\fB crypt\fR (3),
\fB gpasswd\fR (8),
\fB groupadd\fR (8),
\fB groupdel\fR (8),
\fB groupmod\fR (8),
\fB login.defs\fR (5),
\fB useradd\fR (8),
2007-10-07 17:16:52 +05:30
\fB userdel\fR (8).