modify a user account
usermod [options] login
Modifies the account .
The user must not be executing any processes when this command is being executed if the user's
numerical user ID, the user's name, or the user's home directory is being changed.
| Normally modified using the chfn(1) utility.
| login directory.
Move the contents of the user's home directory to the location which is created if it does not already exist.|
Will adapt the ownership of the files and copy the modes, ACL and extended attributes, but
manual changes might be needed afterwards.
When the user account will be disabled. |
An empty DATE disables the expiration
/etc/shadow file. A entry will be created if there were none.
After a password expires until the account is permanently disabled.|
0> disables the account as soon as the password has expired,
-1 disables the feature.
Requires a /etc/shadow file.
The existing group name or number of the user's initial login group. |
Any file from the user's home directory, owned by the previous primary group of the user,
will be owned by this group.
The group ownership of files outside of the user's home directory must be changed manually.
A list of supplementary groups which the user is also a member of. |
The groups are subject to the same restrictions as the group given with
If the user is currently a member of a group which is not listed, the user will be removed from the group, unless
-a is provided which appends the user to the current supplementary group list.
| Add the user to the supplementary group(s). Use only with |
>he name of the user will be changed from LOGIN to NEW_LOGIN.|
Nothing else is changed. In particular, the user's home
directory or mail spool should probably be renamed manually to reflect the new login name.
Lock a user's password. Puts a |
! in front of the encrypted password,
disabling the password. Not with
-p or -U.
To lock the account (not only access with a password), set the EXPIRE_DATE to 1.
| encrypted password, as returned by crypt(3).
Not recommended because the password (or encrypted password) will be visible by users listing the
might differ from the password database configured in the PAM configuration.
Apply changes in the |
CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.
login shell. Setting this field to blank selects the default login shell.
| numerical value of the user's ID.|
must be unique, unless the -o option is used.
The user's mailbox, and any files which the user owns and which are located in the user's home directory will have the file user ID changed automatically.
The ownership of files outside of the user's home directory must be fixed manually.
No checks will be performed with regard to the
UID_MIN, UID_MAX, SYS_UID_MIN, or SYS_UID_MAX from
| With |
-u allows setting user ID to a non-unique value.
Unlock a user's password. removes the '!' in front of the encrypted password. Don't use this option with |
-p or -L.
To unlock the account (not only access with a password), also set the EXPIRE_DATE (for example
to 99999, or to the EXPIRE value from
Add a range of subordinate uids to the user's account.|
May be specified multiple times.
No checks are performed with regard to
SUB_UID_MIN, SUB_UID_MAX, or SUB_UID_COUNT from
Remove a range of subordinate uids from the user's account. |
May be specified multiple times.
When both --del-sub-uids and --add-sub-uids are specified, the removal of all subordinate uid ranges happens before any subordinate uid range is added.
No checks will be performed with regard to SUB_UID_MIN, SUB_UID_MAX, or SUB_UID_COUNT from /etc/login.defs.
Add a range of subordinate gids to the user's account.|
May be specified multiple times to add multiple ranges to a users account.
No checks will be performed with regard to SUB_GID_MIN, SUB_GID_MAX, or SUB_GID_COUNT from /etc/login.defs.
Remove a range of subordinate gids from the user's account.
May be specified multiple times. When both --del-sub-gids and
--add-sub-gids are specified, the removal of all subordinate gid ranges happens before any subordinate gid range is added.|
o checks will be performed with regard to SUB_GID_MIN, SUB_GID_MAX, or SUB_GID_COUNT from /etc/login.defs.
| The new SELinux user for the user's login.|
A blank SEUSER will remove the SELinux user mapping for user LOGIN (if any).
Change the owner of any crontab files or at jobs manually.
Make any changes involving NIS on the NIS server.
The mail spool directory. This is needed to manipulate the mailbox when its corresponding user account is modified or
deleted. If not specified, a compile-time default is used.
Defines the location of the users mail spool files relatively to their home directory.
The MAIL_DIR and MAIL_FILE variables are used by useradd, usermod, and userdel to create, move, or delete the user's mail spool.
Maximum members per group entry. When the maximum is reached, a new group entry (line) is started in /etc/group (with the
same name, same password, and same GID).
The default value is 0, meaning that there are no limits in the number of members in a group.
This feature (split group) permits to limit the length of lines in the group file. This is useful to make sure that lines for
NIS groups are not larger than 1024 characters.
If you need to enforce such limit, you can use 25.
Note: split groups may not be supported by all tools (even in the Shadow toolsuite). You should not use this variable unless
you really need it.
SUB_GID_MIN (number), SUB_GID_MAX (number), SUB_GID_COUNT (number)
If /etc/subuid exists, the commands useradd and newusers (unless the user already have subordinate group IDs) allocate
SUB_GID_COUNT unused group IDs from the range SUB_GID_MIN to SUB_GID_MAX for each new user.
The default values for SUB_GID_MIN, SUB_GID_MAX, SUB_GID_COUNT are respectively 100000, 600100000 and 10000.
SUB_UID_MIN (number), SUB_UID_MAX (number), SUB_UID_COUNT (number)
If /etc/subuid exists, the commands useradd and newusers (unless the user already have subordinate user IDs) allocate
SUB_UID_COUNT unused user IDs from the range SUB_UID_MIN to SUB_UID_MAX for each new user.
The default values for SUB_UID_MIN, SUB_UID_MAX, SUB_UID_COUNT are respectively 100000, 600100000 and 10000.
/etc/group Group account information.
/etc/gshadow Secure group account information.
/etc/login.defs Shadow password suite configuration.
/etc/passwd User account information.
/etc/shadow Secure user account information.
/etc/subgid Per user subordinate group IDs.
/etc/subuid Per user subordinate user IDs.
chfn(1), chsh(1), passwd(1), crypt(3), gpasswd(8), groupadd(8), groupdel(8), groupmod(8), login.defs(5), subgid(5), subuid(5),
change finger information
chfn [options] [LOGIN]
Changes user fullname, office room number, office phone number, and home phone number information for a user's
account, output by finger and similar programs.
A normal user may only change the fields for their own account, subject to the restrictions in
The default prevents changing their fullname.
The superuser may change any field for any account or use
-o to change the undefined portions of the GECOS field.
These fields must not contain any colons. Except for the other field, they should not contain any comma or equal sign.
Avoid non-US-ASCII characters,
| Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.
| other GECOS information. used to store accounting information used by other applications, and can be changed only by a superuser.
If no options are selected, operates in interactive mode,
The values in the gecos field of
/etc/passwd file may be changed by regular users using the
Any combination of
f, r, w, h for
Full name, Room number, Work phone, and Home phone,
yes is equivalent to
no is equivalent to
If not specified, only the superuser can make any changes.
The most restrictive setting is better achieved by not installing