1USERMOD(8)                System Management Commands                USERMOD(8)
2
3
4

NAME

6       usermod - modify a user account
7

SYNOPSIS

9       usermod [options] LOGIN
10

DESCRIPTION

12       The usermod command modifies the system account files to reflect the
13       changes that are specified on the command line.
14

OPTIONS

16       The options which apply to the usermod command are:
17
18       -a, --append
19          Add the user to the supplemental group(s). Use only with -G option.
20
21       -c, --comment COMMENT
22          The new value of the user's password file comment field. It is
23          normally modified using the chfn(1) utility.
24
25       -d, --home HOME_DIR
26          The user's new login directory. If the -m option is given the
27          contents of the current home directory will be moved to the new home
28          directory, which is created if it does not already exist.
29
30       -e, --expiredate EXPIRE_DATE
31          The date on which the user account will be disabled. The date is
32          specified in the format YYYY-MM-DD.
33
34       -f, --inactive INACTIVE
35          The number of days after a password expires until the account is
36          permanently disabled. A value of 0 disables the account as soon as
37          the password has expired, and a value of -1 disables the feature.
38          The default value is -1.
39
40       -g, --gid GROUP
41          The group name or number of the user's new initial login group. The
42          group name must exist. A group number must refer to an already
43          existing group. The default group number is 1.
44
45       -G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
46          A list of supplementary groups which the user is also a member of.
47          Each group is separated from the next by a comma, with no
48          intervening whitespace. The groups are subject to the same
49          restrictions as the group given with the -g option. If the user is
50          currently a member of a group which is not listed, the user will be
51          removed from the group. This behaviour can be changed via -a option,
52          which appends user to the current supplementary group list.
53
54       -l, --login NEW_LOGIN
55          The name of the user will be changed from LOGIN to NEW_LOGIN.
56          Nothing else is changed. In particular, the user's home directory
57          name should probably be changed to reflect the new login name.
58
59       -L, --lock
60          Lock a user's password. This puts a '!' in front of the encrypted
61          password, effectively disabling the password. You can't use this
62          option with -p or -U.
63
64       -o, --non-unique
65          When used with the -u option, this option allows to change the user
66          ID to a non-unique value.
67
68       -p, --password PASSWORD
69          The encrypted password, as returned by crypt(3).
70
71       -s, --shell SHELL
72          The name of the user's new login shell. Setting this field to blank
73          causes the system to select the default login shell.
74
75       -u, --uid UID
76          The numerical value of the user's ID. This value must be unique,
77          unless the -o option is used. The value must be non-negative. Values
78          between 0 and 999 are typically reserved for system accounts. Any
79          files which the user owns and which are located in the directory
80          tree rooted at the user's home directory will have the file user ID
81          changed automatically. Files outside of the user's home directory
82          must be altered manually.
83
84       -U, --unlock
85          Unlock a user's password. This removes the '!' in front of the
86          encrypted password. You can't use this option with -p or -L.
87
88       -Z, --selinux-user SEUSER
89          The SELinux user for the user's login. The default is to leave this
90          field blank, which causes the system to select the default SELinux
91          user.
92
93

CAVEATS

95       usermod will not allow you to change the name of a user who is logged
96       in. You must make certain that the named user is not executing any
97       processes when this command is being executed if the user's numerical
98       user ID is being changed. You must change the owner of any crontab
99       files manually. You must change the owner of any at jobs manually. You
100       must make any changes involving NIS on the NIS server.
101

FILES

103       /etc/group
104          Group account information.
105
106       /etc/passwd
107          User account information.
108
109       /etc/shadow
110          Secure user account information.
111

SEE ALSO

113       chfn(1), chsh(1), passwd(1), crypt(3), gpasswd(8), groupadd(8),
114       groupdel(8), groupmod(8), login.defs(5), useradd(8), userdel(8).
115
116
117
118System Management Commands        07/30/2006                        USERMOD(8)
Impressum