1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
2 .\" May be distributed under the GNU General Public License
3 .TH LOGIN "1" "June 2012" "util-linux" "User Commands"
5 login \- begin session on the system
23 is used when signing onto a system. If no argument is given,
25 prompts for the username.
27 The user is then prompted for a password, where appropriate. Echoing
28 is disabled to prevent revealing the password. Only a small number
29 of password failures are permitted before
31 exits and the communications link is severed.
33 If password aging has been enabled for the account, the user may be
34 prompted for a new password before proceeding. He will be forced to
35 provide his old password and the new password before continuing.
40 The user and group ID will be set according to their values in the
42 file. There is one exception if the user ID is zero: in this case,
43 only the primary group ID of the account is set. This should allow
44 the system administrator to login even in case of network problems.
53 are set according to the appropriate fields in the password entry.
56 .I /usr\:/local\:/bin:\:/bin:\:/usr\:/bin
57 for normal users, and to
58 .I /usr\:/local\:/sbin:\:/usr\:/local\:/bin:\:/sbin:\:/bin:\:/usr\:/sbin:\:/usr\:/bin
59 for root, if not otherwise configured.
61 The environment variable
63 will be preserved, if it exists (other environment variables are
66 option is given), else it will be initialized to the terminal type on your tty.
68 Then the user's shell is started. If no shell is specified for the
73 is used. If there is no directory specified in
77 is used (the home directory is checked for the
79 file described below).
83 exists, then a "quiet" login is performed (this disables the checking
84 of mail and the printing of the last login time and message of the
86 .I /var\:/log\:/lastlog
87 exists, the last login time is printed (and the current login is
96 not to destroy the environment.
99 Used to skip a second login authentication. This specifically does
101 work for root, and does not appear to work well under Linux.
104 Used by other servers (i.e.,
106 to pass the name of the remote host to
108 so that it may be placed in utmp and wtmp. Only the superuser may
113 option has impact on the
116 The standard service name is
122 It is necessary to create proper PAM config files (e.g.
123 .I /etc\:/pam.d\:/login
125 .IR /etc\:/pam.d\:/remote ).
128 Used by other servers (i.e.,
132 that printing the hostname should be suppressed in the login: prompt.
133 See also LOGIN_PLAIN_PROMPT below if your server does not allow to configure
138 Display help text and exit.
140 \fB\-V\fR, \fB\-\-version\fR
141 Display version information and exit.
142 .SH CONFIG FILE ITEMS
145 .IR /etc\:/login.defs (5)
146 configuration file. Note that the configuration file could be
147 distributed with another package (e.g. shadow-utils). The following
148 configuration items are relevant for
154 If defined, a ":" delimited list of "message of the day" files to be
155 displayed upon login. The default value is
159 item is empty or a quiet login is enabled, then the message of the day
160 is not displayed. Note that the same functionality is also provided
166 .B LOGIN_PLAIN_PROMPT
169 Tell login that printing the hostname should be suppressed in the login:
170 prompt. This is alternative to the \fB\-H\fR command line option. The default
178 Max time in seconds for login. The default value is
185 Maximum number of login retries in case of a bad password. The default
193 Delay in seconds before being allowed another three tries after a
194 login failure. The default value is
201 The terminal permissions. The default value is
205 if tty group is used.
211 The login tty will be owned by the
217 does not exist, then the ownership of the terminal is set to the
218 user\'s primary group.
222 can be either the name of a group or a numeric group identifier.
228 If defined, this file can inhibit all the usual chatter during the
229 login sequence. If a full pathname (e.g.
230 .IR /etc\:/hushlogins )
231 is specified, then hushed mode will be enabled if the user\'s name or
232 shell are found in the file. If this global hush login file is empty
233 then the hushed mode will be enabled for all users.
235 If a full pathname is not specified, then hushed mode will be enabled
236 if the file exists in the user\'s home directory.
238 The default is to check
240 and if it does not exist then
245 item is empty, then all the checks are disabled.
251 Indicate if login is allowed if we cannot change directory to the
252 home directory. If set to
254 the user will login in the root (/) directory if it is not possible
255 to change directory to her home. The default value is
262 Highest user ID number for which the lastlog entries should be
263 updated. As higher user IDs are usually tracked by remote user
264 identity and authentication services there is no need to create
265 a huge sparse lastlog file for them. No LASTLOG_UID_MAX option
266 present in the configuration means that there is no user ID limit
267 for writing lastlog entries.
273 Enable display of unknown usernames when login failures are recorded.
277 Note that logging unknown usernames may be a security issue if a
278 user enters her password instead of her login name.
284 If set, it will be used to define the PATH environment variable when
285 a regular user logs in. The default value is
286 .I /usr\:/local\:/bin:\:/bin:\:/usr\:/bin
295 If set, it will be used to define the PATH environment variable when
296 the superuser logs in. ENV_ROOTPATH takes precedence. The default value is
297 .I /usr\:/local\:/sbin:\:/usr\:/local\:/bin:\:/sbin:\:/bin:\:/usr\:/sbin:\:/usr\:/bin
324 option is not supported. This may be required by some
328 A recursive login, as used to be possible in the good old days, no
329 longer works; for most purposes
331 is a satisfactory substitute. Indeed, for security reasons, login
332 does a vhangup() system call to remove any possible listening
333 processes on the tty. This is to avoid password sniffing. If one
336 then the surrounding shell gets killed by vhangup() because it's no
337 longer the true owner of the tty. This can be avoided by using
339 in a top-level shell or xterm.
341 Derived from BSD login 5.40 (5/9/89) by
342 .MT glad@\:daimi.\:dk
347 Ported to Linux 0.12:
348 .MT poe@\:daimi.\:aau.\:dk
352 Rewritten to a PAM-only version by
353 .MT kzak@\:redhat.\:com
357 The login command is part of the util-linux package and is
359 .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/