Tizen 2.1 base
[external/shadow-utils.git] / man / login.1
1 '\" t
2 .\"     Title: login
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
5 .\"      Date: 07/24/2009
6 .\"    Manual: User Commands
7 .\"    Source: User Commands
8 .\"  Language: English
9 .\"
10 .TH "LOGIN" "1" "07/24/2009" "User Commands" "User Commands"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
15 .nh
16 .\" disable justification (adjust text to left margin only)
17 .ad l
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
21 .SH "NAME"
22 login \- begin session on the system
23 .SH "SYNOPSIS"
24 .HP \w'\fBlogin\fR\ 'u
25 \fBlogin\fR [\-p] [\-h\ \fIhost\fR] [\fIusername\fR] [\fIENV=VAR\fR...]
26 .HP \w'\fBlogin\fR\ 'u
27 \fBlogin\fR [\-p] [\-h\ \fIhost\fR] \-f \fIusername\fR
28 .HP \w'\fBlogin\fR\ 'u
29 \fBlogin\fR [\-p] \-r\ \fIhost\fR
30 .SH "DESCRIPTION"
31 .PP
32 The
33 \fBlogin\fR
34 program is used to establish a new session with the system\&. It is normally invoked automatically by responding to the
35 \fIlogin:\fR
36 prompt on the user\'s terminal\&.
37 \fBlogin\fR
38 may be special to the shell and may not be invoked as a sub\-process\&. When called from a shell,
39 \fBlogin\fR
40 should be executed as
41 \fBexec login\fR
42 which will cause the user to exit from the current shell (and thus will prevent the new logged in user to return to the session of the caller)\&. Attempting to execute
43 \fBlogin\fR
44 from any shell but the login shell will produce an error message\&.
45 .PP
46 The user is then prompted for a password, where appropriate\&. Echoing is disabled to prevent revealing the password\&. Only a small number of password failures are permitted before
47 \fBlogin\fR
48 exits and the communications link is severed\&.
49 .PP
50 If password aging has been enabled for your account, you may be prompted for a new password before proceeding\&. You will be forced to provide your old password and the new password before continuing\&. Please refer to
51 \fBpasswd\fR(1)
52 for more information\&.
53 .PP
54 After a successful login, you will be informed of any system messages and the presence of mail\&. You may turn off the printing of the system message file,
55 /etc/motd, by creating a zero\-length file
56 \&.hushlogin
57 in your login directory\&. The mail message will be one of "\fIYou have new mail\&.\fR", "\fIYou have mail\&.\fR", or "\fINo Mail\&.\fR" according to the condition of your mailbox\&.
58 .PP
59 Your user and group ID will be set according to their values in the
60 /etc/passwd
61 file\&. The value for
62 \fB$HOME\fR,
63 \fB$SHELL\fR,
64 \fB$PATH\fR,
65 \fB$LOGNAME\fR, and
66 \fB$MAIL\fR
67 are set according to the appropriate fields in the password entry\&. Ulimit, umask and nice values may also be set according to entries in the GECOS field\&.
68 .PP
69 On some installations, the environmental variable
70 \fB$TERM\fR
71 will be initialized to the terminal type on your tty line, as specified in
72 /etc/ttytype\&.
73 .PP
74 An initialization script for your command interpreter may also be executed\&. Please see the appropriate manual section for more information on this function\&.
75 .PP
76 A subsystem login is indicated by the presence of a "*" as the first character of the login shell\&. The given home directory will be used as the root of a new file system which the user is actually logged into\&.
77 .PP
78 The
79 \fBlogin\fR
80 program is NOT responsible for removing users from the utmp file\&. It is the responsibility of
81 \fBgetty\fR(8)
82 and
83 \fBinit\fR(8)
84 to clean up apparent ownership of a terminal session\&. If you use
85 \fBlogin\fR
86 from the shell prompt without
87 \fBexec\fR, the user you use will continue to appear to be logged in even after you log out of the "subsession"\&.
88 .SH "OPTIONS"
89 .PP
90 \fB\-f\fR
91 .RS 4
92 Do not perform authentication, user is preauthenticated\&.
93 .sp
94 Note: In that case,
95 \fIusername\fR
96 is mandatory\&.
97 .RE
98 .PP
99 \fB\-h\fR
100 .RS 4
101 Name of the remote host for this login\&.
102 .RE
103 .PP
104 \fB\-p\fR
105 .RS 4
106 Preserve environment\&.
107 .RE
108 .PP
109 \fB\-r\fR
110 .RS 4
111 Perform autologin protocol for rlogin\&.
112 .RE
113 .PP
114 The
115 \fB\-r\fR,
116 \fB\-h\fR
117 and
118 \fB\-f\fR
119 options are only used when
120 \fBlogin\fR
121 is invoked by root\&.
122 .SH "CAVEATS"
123 .PP
124 This version of
125 \fBlogin\fR
126 has many compilation options, only some of which may be in use at any particular site\&.
127 .PP
128 The location of files is subject to differences in system configuration\&.
129 .PP
130 The
131 \fBlogin\fR
132 program is NOT responsible for removing users from the utmp file\&. It is the responsibility of
133 \fBgetty\fR(8)
134 and
135 \fBinit\fR(8)
136 to clean up apparent ownership of a terminal session\&. If you use
137 \fBlogin\fR
138 from the shell prompt without
139 \fBexec\fR, the user you use will continue to appear to be logged in even after you log out of the "subsession"\&.
140 .PP
141 As with any program,
142 \fBlogin\fR\'s appearance can be faked\&. If non\-trusted users have physical access to a machine, an attacker could use this to obtain the password of the next person coming to sit in front of the machine\&. Under Linux, the SAK mechanism can be used by users to initiate a trusted path and prevent this kind of attack\&.
143 .SH "CONFIGURATION"
144 .PP
145 The following configuration variables in
146 /etc/login\&.defs
147 change the behavior of this tool:
148 .PP
149 \fBCONSOLE\fR (string)
150 .RS 4
151 If defined, either full pathname of a file containing device names (one per line) or a ":" delimited list of device names\&. Root logins will be allowed only upon these devices\&.
152 .sp
153 If not defined, root will be allowed on any device\&.
154 .sp
155 The device should be specified without the /dev/ prefix\&.
156 .RE
157 .PP
158 \fBCONSOLE_GROUPS\fR (string)
159 .RS 4
160 List of groups to add to the user\'s supplementary groups set when logging in on the console (as determined by the CONSOLE setting)\&. Default is none\&.
161
162 Use with caution \- it is possible for users to gain permanent access to these groups, even when not logged in on the console\&.
163 .RE
164 .PP
165 \fBDEFAULT_HOME\fR (boolean)
166 .RS 4
167 Indicate if login is allowed if we can\'t cd to the home directory\&. Default in no\&.
168 .sp
169 If set to
170 \fIyes\fR, the user will login in the root (/) directory if it is not possible to cd to her home directory\&.
171 .RE
172 .PP
173 \fBENV_HZ\fR (string)
174 .RS 4
175 If set, it will be used to define the HZ environment variable when a user login\&. The value must be preceded by
176 \fIHZ=\fR\&. A common value on Linux is
177 \fIHZ=100\fR\&.
178 .RE
179 .PP
180 \fBENV_PATH\fR (string)
181 .RS 4
182 If set, it will be used to define the PATH environment variable when a regular user login\&. The value can be preceded by
183 \fIPATH=\fR, or a colon separated list of paths (for example
184 \fI/bin:/usr/bin\fR)\&. The default value is
185 \fIPATH=/bin:/usr/bin\fR\&.
186 .RE
187 .PP
188 \fBENV_SUPATH\fR (string)
189 .RS 4
190 If set, it will be used to define the PATH environment variable when the superuser login\&. The value can be preceded by
191 \fIPATH=\fR, or a colon separated list of paths (for example
192 \fI/sbin:/bin:/usr/sbin:/usr/bin\fR)\&. The default value is
193 \fIPATH=/bin:/usr/bin\fR\&.
194 .RE
195 .PP
196 \fBENV_TZ\fR (string)
197 .RS 4
198 If set, it will be used to define the TZ environment variable when a user login\&. The value can be the name of a timezone preceded by
199 \fITZ=\fR
200 (for example
201 \fITZ=CST6CDT\fR), or the full path to the file containing the timezone specification (for example
202 /etc/tzname)\&.
203 .sp
204 If a full path is specified but the file does not exist or cannot be read, the default is to use
205 \fITZ=CST6CDT\fR\&.
206 .RE
207 .PP
208 \fBENVIRON_FILE\fR (string)
209 .RS 4
210 If this file exists and is readable, login environment will be read from it\&. Every line should be in the form name=value\&.
211 .sp
212 Lines starting with a # are treated as comment lines and ignored\&.
213 .RE
214 .PP
215 \fBERASECHAR\fR (number)
216 .RS 4
217 Terminal ERASE character (\fI010\fR
218 = backspace,
219 \fI0177\fR
220 = DEL)\&.
221 .sp
222 The value can be prefixed "0" for an octal value, or "0x" for an hexadecimal value\&.
223 .RE
224 .PP
225 \fBFAIL_DELAY\fR (number)
226 .RS 4
227 Delay in seconds before being allowed another attempt after a login failure\&.
228 .RE
229 .PP
230 \fBFAILLOG_ENAB\fR (boolean)
231 .RS 4
232 Enable logging and display of
233 /var/log/faillog
234 login failure info\&.
235 .RE
236 .PP
237 \fBFAKE_SHELL\fR (string)
238 .RS 4
239 If set,
240 \fBlogin\fR
241 will execute this shell instead of the users\' shell specified in
242 /etc/passwd\&.
243 .RE
244 .PP
245 \fBFTMP_FILE\fR (string)
246 .RS 4
247 If defined, login failures will be logged in this file in a utmp format\&.
248 .RE
249 .PP
250 \fBHUSHLOGIN_FILE\fR (string)
251 .RS 4
252 If defined, this file can inhibit all the usual chatter during the login sequence\&. If a full pathname is specified, then hushed mode will be enabled if the user\'s name or shell are found in the file\&. If not a full pathname, then hushed mode will be enabled if the file exists in the user\'s home directory\&.
253 .RE
254 .PP
255 \fBISSUE_FILE\fR (string)
256 .RS 4
257 If defined, this file will be displayed before each login prompt\&.
258 .RE
259 .PP
260 \fBKILLCHAR\fR (number)
261 .RS 4
262 Terminal KILL character (\fI025\fR
263 = CTRL/U)\&.
264 .sp
265 The value can be prefixed "0" for an octal value, or "0x" for an hexadecimal value\&.
266 .RE
267 .PP
268 \fBLASTLOG_ENAB\fR (boolean)
269 .RS 4
270 Enable logging and display of /var/log/lastlog login time info\&.
271 .RE
272 .PP
273 \fBLOGIN_RETRIES\fR (number)
274 .RS 4
275 Maximum number of login retries in case of bad password\&.
276 .RE
277 .PP
278 \fBLOGIN_STRING\fR (string)
279 .RS 4
280 The string used for prompting a password\&. The default is to use "Password: ", or a translation of that string\&. If you set this variable, the prompt will no be translated\&.
281 .sp
282 If the string contains
283 \fI%s\fR, this will be replaced by the user\'s name\&.
284 .RE
285 .PP
286 \fBLOGIN_TIMEOUT\fR (number)
287 .RS 4
288 Max time in seconds for login\&.
289 .RE
290 .PP
291 \fBLOG_OK_LOGINS\fR (boolean)
292 .RS 4
293 Enable logging of successful logins\&.
294 .RE
295 .PP
296 \fBLOG_UNKFAIL_ENAB\fR (boolean)
297 .RS 4
298 Enable display of unknown usernames when login failures are recorded\&.
299 .sp
300 Note: logging unknown usernames may be a security issue if an user enter her password instead of her login name\&.
301 .RE
302 .PP
303 \fBMAIL_CHECK_ENAB\fR (boolean)
304 .RS 4
305 Enable checking and display of mailbox status upon login\&.
306 .sp
307 You should disable it if the shell startup files already check for mail ("mailx \-e" or equivalent)\&.
308 .RE
309 .PP
310 \fBMAIL_DIR\fR (string)
311 .RS 4
312 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\&.
313 .RE
314 .PP
315 \fBMAIL_FILE\fR (string)
316 .RS 4
317 Defines the location of the users mail spool files relatively to their home directory\&.
318 .RE
319 .PP
320 The
321 \fBMAIL_DIR\fR
322 and
323 \fBMAIL_FILE\fR
324 variables are used by
325 \fBuseradd\fR,
326 \fBusermod\fR, and
327 \fBuserdel\fR
328 to create, move, or delete the user\'s mail spool\&.
329 .PP
330 If
331 \fBMAIL_CHECK_ENAB\fR
332 is set to
333 \fIyes\fR, they are also used to define the
334 \fBMAIL\fR
335 environment variable\&.
336 .PP
337 \fBMOTD_FILE\fR (string)
338 .RS 4
339 If defined, ":" delimited list of "message of the day" files to be displayed upon login\&.
340 .RE
341 .PP
342 \fBNOLOGINS_FILE\fR (string)
343 .RS 4
344 If defined, name of file whose presence will inhibit non\-root logins\&. The contents of this file should be a message indicating why logins are inhibited\&.
345 .RE
346 .PP
347 \fBPORTTIME_CHECKS_ENAB\fR (boolean)
348 .RS 4
349 Enable checking of time restrictions specified in /etc/porttime\&.
350 .RE
351 .PP
352 \fBQUOTAS_ENAB\fR (boolean)
353 .RS 4
354 Enable setting of ulimit, umask, and niceness from passwd gecos field\&.
355 .RE
356 .PP
357 \fBTTYGROUP\fR (string), \fBTTYPERM\fR (string)
358 .RS 4
359 The terminal permissions: the login tty will be owned by the
360 \fBTTYGROUP\fR
361 group, and the permissions will be set to
362 \fBTTYPERM\fR\&.
363 .sp
364 By default, the ownership of the terminal is set to the user\'s primary group and the permissions are set to
365 \fI0600\fR\&.
366 .sp
367
368 \fBTTYGROUP\fR
369 can be either the name of a group or a numeric group identifier\&.
370 .sp
371 If you have a
372 \fBwrite\fR
373 program which is "setgid" to a special group which owns the terminals, define TTYGROUP to the group number and TTYPERM to 0620\&. Otherwise leave TTYGROUP commented out and assign TTYPERM to either 622 or 600\&.
374 .RE
375 .PP
376 \fBTTYTYPE_FILE\fR (string)
377 .RS 4
378 If defined, file which maps tty line to TERM environment parameter\&. Each line of the file is in a format something like "vt100 tty01"\&.
379 .RE
380 .PP
381 \fBULIMIT\fR (number)
382 .RS 4
383 Default
384 \fBulimit\fR
385 value\&.
386 .RE
387 .PP
388 \fBUMASK\fR (number)
389 .RS 4
390 The file mode creation mask is initialized to this value\&. If not specified, the mask will be initialized to 022\&.
391 .sp
392
393 \fBuseradd\fR
394 and
395 \fBnewusers\fR
396 use this mask to set the mode of the home directory they create
397 .sp
398 It is also used by
399 \fBlogin\fR
400 to define users\' initial umask\&. Note that this mask can be overriden by the user\'s GECOS line (if
401 \fBQUOTAS_ENAB\fR
402 is set) or by the specification of a limit with the
403 \fIK\fR
404 identifier in
405 \fBlimits\fR(5)\&.
406 .RE
407 .PP
408 \fBUSERGROUPS_ENAB\fR (boolean)
409 .RS 4
410 Enable setting of the umask group bits to be the same as owner bits (examples: 022 \-> 002, 077 \-> 007) for non\-root users, if the uid is the same as gid, and username is the same as the primary group name\&.
411 .sp
412 If set to
413 \fIyes\fR,
414 \fBuserdel\fR
415 will remove the user\'s group if it contains no more members, and
416 \fBuseradd\fR
417 will create by default a group with the name of the user\&.
418 .RE
419 .SH "FILES"
420 .PP
421 /var/run/utmp
422 .RS 4
423 List of current login sessions\&.
424 .RE
425 .PP
426 /var/log/wtmp
427 .RS 4
428 List of previous login sessions\&.
429 .RE
430 .PP
431 /etc/passwd
432 .RS 4
433 User account information\&.
434 .RE
435 .PP
436 /etc/shadow
437 .RS 4
438 Secure user account information\&.
439 .RE
440 .PP
441 /etc/motd
442 .RS 4
443 System message of the day file\&.
444 .RE
445 .PP
446 /etc/nologin
447 .RS 4
448 Prevent non\-root users from logging in\&.
449 .RE
450 .PP
451 /etc/ttytype
452 .RS 4
453 List of terminal types\&.
454 .RE
455 .PP
456 $HOME/\&.hushlogin
457 .RS 4
458 Suppress printing of system messages\&.
459 .RE
460 .PP
461 /etc/login\&.defs
462 .RS 4
463 Shadow password suite configuration\&.
464 .RE
465 .SH "SEE ALSO"
466 .PP
467
468 \fBmail\fR(1),
469 \fBpasswd\fR(1),
470 \fBsh\fR(1),
471 \fBsu\fR(1),
472 \fBlogin.defs\fR(5),
473 \fBnologin\fR(5),
474 \fBpasswd\fR(5),
475 \fBsecuretty\fR(5),
476 \fBgetty\fR(8)\&.