Initial commit for Tizen
[profile/extras/shadow-utils.git] / man / usermod.8
1 '\" t
2 .\"     Title: usermod
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5 .\"      Date: 02/16/2011
6 .\"    Manual: System Management Commands
7 .\"    Source: System Management Commands
8 .\"  Language: English
9 .\"
10 .TH "USERMOD" "8" "02/16/2011" "System Management Commands" "System Management Commands"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 usermod \- modify a user account
32 .SH "SYNOPSIS"
33 .HP \w'\fBusermod\fR\ 'u
34 \fBusermod\fR [\fIoptions\fR] \fILOGIN\fR
35 .SH "DESCRIPTION"
36 .PP
37 The
38 \fBusermod\fR
39 command modifies the system account files to reflect the changes that are specified on the command line\&.
40 .SH "OPTIONS"
41 .PP
42 The options which apply to the
43 \fBusermod\fR
44 command are:
45 .PP
46 \fB\-a\fR, \fB\-\-append\fR
47 .RS 4
48 Add the user to the supplementary group(s)\&. Use only with the
49 \fB\-G\fR
50 option\&.
51 .RE
52 .PP
53 \fB\-c\fR, \fB\-\-comment\fR \fICOMMENT\fR
54 .RS 4
55 The new value of the user\*(Aqs password file comment field\&. It is normally modified using the
56 \fBchfn\fR(1)
57 utility\&.
58 .RE
59 .PP
60 \fB\-d\fR, \fB\-\-home\fR \fIHOME_DIR\fR
61 .RS 4
62 The user\*(Aqs new login directory\&.
63 .sp
64 If the
65 \fB\-m\fR
66 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\&.
67 .RE
68 .PP
69 \fB\-e\fR, \fB\-\-expiredate\fR \fIEXPIRE_DATE\fR
70 .RS 4
71 The date on which the user account will be disabled\&. The date is specified in the format
72 \fIYYYY\-MM\-DD\fR\&.
73 .RE
74 .PP
75 \fB\-f\fR, \fB\-\-inactive\fR \fIINACTIVE\fR
76 .RS 4
77 The number of days after a password expires until the account is permanently disabled\&.
78 .sp
79 A value of 0 disables the account as soon as the password has expired, and a value of \-1 disables the feature\&.
80 .RE
81 .PP
82 \fB\-g\fR, \fB\-\-gid\fR \fIGROUP\fR
83 .RS 4
84 The group name or number of the user\*(Aqs new initial login group\&. The group must exist\&.
85 .RE
86 .PP
87 \fB\-G\fR, \fB\-\-groups\fR \fIGROUP1\fR[\fI,GROUP2,\&.\&.\&.\fR[\fI,GROUPN\fR]]]
88 .RS 4
89 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
90 \fB\-g\fR
91 option\&.
92 .sp
93 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 the
94 \fB\-a\fR
95 option, which appends the user to the current supplementary group list\&.
96 .RE
97 .PP
98 \fB\-l\fR, \fB\-\-login\fR \fINEW_LOGIN\fR
99 .RS 4
100 The name of the user will be changed from
101 \fILOGIN\fR
102 to
103 \fINEW_LOGIN\fR\&. Nothing else is changed\&. In particular, the user\*(Aqs home directory name should probably be changed manually to reflect the new login name\&.
104 .RE
105 .PP
106 \fB\-L\fR, \fB\-\-lock\fR
107 .RS 4
108 Lock a user\*(Aqs password\&. This puts a \*(Aq!\*(Aq in front of the encrypted password, effectively disabling the password\&. You can\*(Aqt use this option with
109 \fB\-p\fR
110 or
111 \fB\-U\fR\&.
112 .sp
113 Note: if you wish to lock the account (not only access with a password), you should also set the
114 \fIEXPIRE_DATE\fR
115 to
116 \fI1\fR\&.
117 .RE
118 .PP
119 \fB\-m\fR, \fB\-\-move\-home\fR
120 .RS 4
121 Move the content of the user\*(Aqs home directory to the new location\&.
122 .sp
123 This option is only valid in combination with the
124 \fB\-d\fR
125 (or
126 \fB\-\-home\fR) option\&.
127 .RE
128 .PP
129 \fB\-o\fR, \fB\-\-non\-unique\fR
130 .RS 4
131 When used with the
132 \fB\-u\fR
133 option, this option allows to change the user ID to a non\-unique value\&.
134 .RE
135 .PP
136 \fB\-p\fR, \fB\-\-password\fR \fIPASSWORD\fR
137 .RS 4
138 The encrypted password, as returned by
139 \fBcrypt\fR(3)\&.
140 .sp
141
142 \fBNote:\fR
143 This option is not recommended because the password (or encrypted password) will be visible by users listing the processes\&.
144 .sp
145 You should make sure the password respects the system\*(Aqs password policy\&.
146 .RE
147 .PP
148 \fB\-s\fR, \fB\-\-shell\fR \fISHELL\fR
149 .RS 4
150 The name of the user\*(Aqs new login shell\&. Setting this field to blank causes the system to select the default login shell\&.
151 .RE
152 .PP
153 \fB\-u\fR, \fB\-\-uid\fR \fIUID\fR
154 .RS 4
155 The new numerical value of the user\*(Aqs ID\&.
156 .sp
157 This value must be unique, unless the
158 \fB\-o\fR
159 option is used\&. The value must be non\-negative\&. Values between 0 and 999 are typically reserved for system accounts\&.
160 .sp
161 The user\*(Aqs mailbox, and any files which the user owns and which are located in the user\*(Aqs home directory will have the file user ID changed automatically\&.
162 .sp
163 The ownership of files outside of the user\*(Aqs home directory must be fixed manually\&.
164 .RE
165 .PP
166 \fB\-U\fR, \fB\-\-unlock\fR
167 .RS 4
168 Unlock a user\*(Aqs password\&. This removes the \*(Aq!\*(Aq in front of the encrypted password\&. You can\*(Aqt use this option with
169 \fB\-p\fR
170 or
171 \fB\-L\fR\&.
172 .sp
173 Note: if you wish to unlock the account (not only access with a password), you should also set the
174 \fIEXPIRE_DATE\fR
175 (for example to
176 \fI99999\fR, or to the
177 \fBEXPIRE\fR
178 value from
179 /etc/default/useradd)\&.
180 .RE
181 .PP
182 \fB\-Z\fR, \fB\-\-selinux\-user\fR \fISEUSER\fR
183 .RS 4
184 The SELinux user for the user\*(Aqs login\&. The default is to leave this field the blank, which causes the system to select the default SELinux user\&.
185 .RE
186 .SH "CAVEATS"
187 .PP
188 You must make certain that the named user is not executing any processes when this command is being executed if the user\*(Aqs numerical user ID, the user\*(Aqs name, or the user\*(Aqs home directory is being changed\&.
189 \fBusermod\fR
190 checks this on Linux, but only check if the user is logged in according to utmp on other architectures\&.
191 .PP
192 You must change the owner of any
193 \fBcrontab\fR
194 files or
195 \fBat\fR
196 jobs manually\&.
197 .PP
198 You must make any changes involving NIS on the NIS server\&.
199 .SH "CONFIGURATION"
200 .PP
201 The following configuration variables in
202 /etc/login\&.defs
203 change the behavior of this tool:
204 .PP
205 \fBMAIL_DIR\fR (string)
206 .RS 4
207 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\&.
208 .RE
209 .PP
210 \fBMAIL_FILE\fR (string)
211 .RS 4
212 Defines the location of the users mail spool files relatively to their home directory\&.
213 .RE
214 .PP
215 The
216 \fBMAIL_DIR\fR
217 and
218 \fBMAIL_FILE\fR
219 variables are used by
220 \fBuseradd\fR,
221 \fBusermod\fR, and
222 \fBuserdel\fR
223 to create, move, or delete the user\*(Aqs mail spool\&.
224 .PP
225 If
226 \fBMAIL_CHECK_ENAB\fR
227 is set to
228 \fIyes\fR, they are also used to define the
229 \fBMAIL\fR
230 environment variable\&.
231 .PP
232 \fBMAX_MEMBERS_PER_GROUP\fR (number)
233 .RS 4
234 Maximum members per group entry\&. When the maximum is reached, a new group entry (line) is started in
235 /etc/group
236 (with the same name, same password, and same GID)\&.
237 .sp
238 The default value is 0, meaning that there are no limits in the number of members in a group\&.
239 .sp
240 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\&.
241 .sp
242 If you need to enforce such limit, you can use 25\&.
243 .sp
244 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\&.
245 .RE
246 .SH "FILES"
247 .PP
248 /etc/group
249 .RS 4
250 Group account information\&.
251 .RE
252 .PP
253 /etc/gshadow
254 .RS 4
255 Secure group account information\&.
256 .RE
257 .PP
258 /etc/passwd
259 .RS 4
260 User account information\&.
261 .RE
262 .PP
263 /etc/shadow
264 .RS 4
265 Secure user account information\&.
266 .RE
267 .SH "SEE ALSO"
268 .PP
269
270 \fBchfn\fR(1),
271 \fBchsh\fR(1),
272 \fBpasswd\fR(1),
273 \fBcrypt\fR(3),
274 \fBgpasswd\fR(8),
275 \fBgroupadd\fR(8),
276 \fBgroupdel\fR(8),
277 \fBgroupmod\fR(8),
278 \fBlogin.defs\fR(5),
279 \fBuseradd\fR(8),
280 \fBuserdel\fR(8)\&.