Manual Page Result
0
Command: usermod | Section: 8 | Source: Digital UNIX | File: usermod.8.gz
usermod(8) System Manager's Manual usermod(8)
NAME
usermod - Modifies a user's login information on the system.
SYNOPSIS
/usr/sbin/usermod [-u uid [-o]] [-g group] [-G group[,group...]] [-c
comment] [-d home [-m ]] [-s shell] [-l new_login] [-t type] [-x ex-
tended_option] login
/usr/sbin/usermod -D [-g group] [-d base_home] [-s shell] [-x ex-
tended_option]
FLAGS
When used without arguments, this flag displays the system defaults for
user and group information. If invoked with other flags, it sets the
system defaults for the flags specified. This flag is a comma sepa-
rated list of groups that defines the supplementary group membership of
the user account being modified. Groups can be specified by the
group's name or by its group identification number (GID). An error is
displayed for each group that does not exist. Duplicate groups are ig-
nored. Modifies a local plus (+) or local minus (-) NIS user from the
user database. The value of the type parameter can be + or -. Speci-
fies a short description of the login, and is currently used as the
field for the user's full name in the user database file. The comment
argument can be any text string. If the string contains spaces, en-
close the string in quotes. Redefines the directory in which the
user's home directory resides or if used with the -D flag, the -d
base_home flag redefines the system default for the base directory for
user accounts. Redefines the user's primary group membership. It can
be specified as an existing group's identification number (GID) or
character-string name. Specifies the new login name for the user. It
can be a string of any printable characters, except a colon (:) or new-
line (\n) character. Moves the user's home directory to a new direc-
tory, specified with the -d flag. If the directory already exists, it
must have read, write, and execute permissions by group, where group is
the user's primary group. This flag can be used only with the -d flag.
Allows a user identification (UID) number to be duplicated (non-
unique). This flag can be used only with the -u flag. Modifies a
user's login shell. The shell argument must be a valid executable file
and you should specify the full pathname of the new shell. Specifies
the new user identification number (UID) for the user. The uid must be
specified as a non-negative decimal integer.
The following extended_option attributes are available. If you
use more than one extended_option attribute on the command line,
you must precede each attribute with the -x flag or enclose the
desired attributes in quotes. Specifies the system default base
directory which is then used when new accounts are checked. The
new user's home directory is dir_string/login. This flag can be
used only with the -D flag. Specifies the largest numeric iden-
tifier which can be associated with a user. The value must be
specified as a non-negative decimal integer. Specifies the
smallest numeric identifier which can be associated with a user.
The value must be specified as a non-negative decimal integer.
Specifies the next available UID in the range of min_uid to
max_uid. The value must be specified as a non-negative decimal
integer. Specifies the numeric identifier associated with a
group account. The value must be specified as a non-negative
decimal integer. Indicates whether or not the account is dis-
tributed. The value of the distributed=n attribute can be 0 or
1. If set to 0, the account is maintained on the local system.
If set to 1, the account is maintained in the NIS master data-
base on the running system. Indicates whether or not the ac-
count is local. The value of the local=n attribute can be 0 or
1. If set to 1, the account is stored on a local database. If
set to 0, the account information is not stored locally, but ex-
ists in the NIS master database. Indicates whether or not the
account is locked by the system administrator. The value of the
administrative_lock_applied=n attribute can be 0 or 1. If set
to 0, the account is not locked. If set to 1, the account is
explicitly locked by the system administrator. Indicates the
database search order. The value of the local_first=n attribute
can be 0 or 1. If set to 0 and a cell database (NIS) exists,
that database is inspected first. If set to 1, the local data-
base is inspected first. Indicates the home directory of the
user being modified. This directory overrides the home direc-
tory in the NIS database. Indicates the default login shell of
the new user. This directory overrides the default shell in the
NIS database.
The following extended_option attributes are available only on
systems running in enhanced security mode: Specifies the time,
in days, between the last password change and the password expi-
ration. (A new password must be chosen.) The value of n must be
an integer. If the passwd_expiration_time attribute is set to
0, there is no password expiration time. Indicates the time, in
days, between the last password change and the expiration of the
account. The value of n must be an integer. If the
passwd_lifetime attribute is set to 0, the password lifetime is
infinite. Specifies the time, in days, which must pass before a
user can change the user account password. The value of n must
be an integer. The passwd_min_change_time=0 flag means there is
no minimum time required to change the user account password.
Specifies the existing login name of the user.
DESCRIPTION
The usermod command modifies a user's login definition on the system
and makes the login-related changes in the appropriate system files de-
termined by the current level of security.
The system file entries created with this command have a limit of 512
characters per line. Specifying long arguments to several flags may
exceed this limit.
With the -x flag, the system administrator can specify whether the user
login account to be modified is local or whether it resides in the NIS
master database. If the -x flag is not specified, the user login ac-
count is modified from the appropriate database as specified by the
system defaults.
The default behavior on the system for the usermod command is distrib-
uted=0 and local=1. With these values, the system modifies the user
login definition at the local database by default. Setting the dis-
tributed= and local= attributes to the same value (for example, dis-
tributed=0 and local=0) produces an error.
You must have superuser privilege to execute this command.
EXAMPLES
The following example changes the GID of the user, newuser, to 451 in
the user database: % usermod -u 451 newuser
The following example changes the home directory of the user, xyz to
/users/xyz, and moves the files from the user's current directory to
the new directory: % usermod -d /users/xyz -m xyz
The following example changes the login shell of the user, abc, in the
NIS master database on the system where the command is executed: %
usermod -s /bin/csh -x distributed=1 abc
The following example changes the user's login name from abc to xyz: %
usermod -l xyz abc
The following example sets the system default shell for use by subse-
quent account management commands: % usermod -D -s /bin/sh
The following example changes the primary group of the user, abc, to
15: % usermod -g 15 abc
EXIT VALUES
The usermod command exits with one of the following values: Success In-
valid command syntax or insufficient privilege. A usage message for
the usermod command or an error message is displayed. An invalid argu-
ment was provided to an option. The UID, which is specified with the
-u flag is already in use (not unique). The login to be modified does
not exist, or the group does not exist. The login to be modified is in
use. The new_logname is already in use. Cannot update the group data-
base. Other update requests will be implemented. Insufficient space
to move the home directory (-m flag). Other update requests will be
implemented. Unable to complete the move of the home directory to the
new home directory.
FILES
The usermod command operates on the appropriate files for the specific
level of system security.
RELATED INFORMATION
Commands: groupadd(8), groupdel(8), groupmod(8), useradd(8),
userdel(8)
Documents: System Administration, Security delim off
usermod(8)