2 .\" Copyright (C) 2008, Sun Microsystems, Inc. All Rights Reserved
3 .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH LOGIN 1 "Mar 24, 2017"
9 login \- sign on to the system
13 \fBlogin\fR [\fB-p\fR] [\fB-d\fR \fIdevice\fR] [\fB-R\fR \fIrepository\fR] [\fB-s\fR \fIservice\fR]
14 [\fB-t\fR \fIterminal\fR] [\fB-u\fR \fIidentity\fR] [\fB-U\fR \fIruser\fR]
15 [\fB-h\fR \fIhostname\fR \fI[terminal]\fR | \fIhostname\fR]
16 [\fIname\fR [\fIenviron\fR]...]
21 The \fBlogin\fR command is used at the beginning of each terminal session to
22 identify oneself to the system. \fBlogin\fR is invoked by the system when a
23 connection is first established, after the previous user has terminated the
24 login shell by issuing the \fBexit\fR command.
27 If \fBlogin\fR is invoked as a command, it must replace the initial command
28 interpreter. To invoke \fBlogin\fR in this fashion, type:
39 from the initial shell. The C shell and Korn shell have their own built-ins of
40 \fBlogin\fR. See \fBksh\fR(1), \fBksh93\fR(1), and \fBcsh\fR(1) for
41 descriptions of login built-ins and usage.
44 \fBlogin\fR asks for your user name, if it is not supplied as an argument, and
45 your password, if appropriate. Where possible, echoing is turned off while you
46 type your password, so it does not appear on the written record of the session.
49 If you make any mistake in the login procedure, the message:
60 is printed and a new login prompt appears. If you make five incorrect login
61 attempts, all five can be logged in \fB/var/adm/loginlog\fR, if it exists. The
62 \fBTTY\fR line is dropped.
65 If password aging is turned on and the password has aged (see \fBpasswd\fR(1)
66 for more information), the user is forced to changed the password. In this case
67 the \fB/etc/nsswitch.conf\fR file is consulted to determine password
68 repositories. See \fBnsswitch.conf\fR(4) for a list of valid nameservice
69 configurations that are permitted for the \fBpasswd\fR: database if password
73 Failure to comply with the configurations prevents the user from logging onto
74 the system because \fBpasswd\fR(1) fails. If you do not complete the login
75 successfully within a certain period of time, it is likely that you are
76 silently disconnected.
79 After a successful login, accounting files are updated. Device owner, group,
80 and permissions are set according to the contents of the
81 \fB/etc/logindevperm\fR file, and the time you last logged in as well as the
82 message of the day (\fB/etc/motd\fR) are printed, unless \fB$HOME/.hushlogin\fR
86 The user-ID, group-ID, supplementary group list, and working directory are
87 initialized, and the command interpreter (usually \fBksh\fR) is started.
90 The basic \fIenvironment\fR is initialized to:
94 HOME=\fIyour-login-directory\fR
95 LOGNAME=\fIyour-login-name\fR
97 SHELL=\fIlast-field-of-passwd-entry\fR
99 TZ=\fItimezone-specification\fR
105 If the \fIlogin-shell\fR field in the password file (see \fBpasswd\fR(4)) is
106 empty, then the default command interpreter, \fB/usr/bin/sh\fR, is used. If
107 this field is * (asterisk), then the named directory becomes the root
108 directory. At that point, \fBlogin\fR is re-executed at the new level, which
109 must have its own root structure.
112 The environment can be expanded or modified by supplying additional arguments
113 to \fBlogin\fR, either at execution time or when \fBlogin\fR requests your
114 login name. The arguments can take either the form \fIxxx\fR or \fIxxx=yyy\fR.
115 Arguments without an \fB=\fR (equal sign) are placed in the environment as:
126 where \fIn\fR is a number starting at \fB0\fR and is incremented each time a
127 new variable name is required. Variables containing an \fB=\fR (equal sign) are
128 placed in the environment without modification. If they already appear in the
129 environment, then they replace the older values.
132 There are two exceptions: The variables \fBPATH\fR and \fBSHELL\fR cannot be
133 changed. This prevents people logged into restricted shell environments from
134 spawning secondary shells that are not restricted. \fBlogin\fR understands
135 simple single-character quoting conventions. Typing a \fB\e\fR\| (backslash) in
136 front of a character quotes it and allows the inclusion of such characters as
140 Alternatively, you can pass the current environment by supplying the \fB-p\fR
141 flag to \fBlogin\fR. This flag indicates that all currently defined environment
142 variables should be passed, if possible, to the new environment. This option
143 does not bypass any environment variable restrictions mentioned above.
144 Environment variables specified on the login line take precedence, if a
145 variable is passed by both methods.
148 To enable remote logins by root, edit the \fB/etc/default/login\fR file by
149 inserting a \fB#\fR (pound sign) before the \fBCONSOLE=/dev/console\fR entry.
153 For accounts in name services which support automatic account locking, the
154 account can be configured to be automatically locked (see \fBuser_attr\fR(4)
155 and \fBpolicy.conf\fR(4)) if successive failed login attempts equals or exceeds
156 \fBRETRIES\fR. Currently, only the files repository (see \fBpasswd\fR(4) and
157 \fBshadow\fR(4)) supports automatic account locking. See also
158 \fBpam_unix_auth\fR(5).
161 The \fBlogin\fR command uses \fBpam\fR(3PAM) for authentication, account
162 management, session management, and password management. The \fBPAM\fR
163 configuration policy, listed through \fB/etc/pam.conf\fR, specifies the modules
164 to be used for \fBlogin\fR. Here is a partial \fBpam.conf\fR file with entries
165 for the \fBlogin\fR command using the UNIX authentication, account management,
166 and session management modules:
170 login auth required pam_authtok_get.so.1
171 login auth required pam_dhkeys.so.1
172 login auth required pam_unix_auth.so.1
173 login auth required pam_dial_auth.so.1
175 login account requisite pam_roles.so.1
176 login account required pam_unix_account.so.1
178 login session required pam_unix_session.so.1
184 The Password Management stack looks like the following:
188 other password required pam_dhkeys.so.1
189 other password requisite pam_authtok_get.so.1
190 other password requisite pam_authtok_check.so.1
191 other password required pam_authtok_store.so.1
197 If there are no entries for the service, then the entries for the \fBother\fR
198 service is used. If multiple authentication modules are listed, then the user
199 can be prompted for multiple passwords.
202 The following options are supported:
206 \fB\fB-d\fR \fIdevice\fR\fR
209 \fBlogin\fR accepts a device option, \fIdevice\fR. \fIdevice\fR is taken to be
210 the path name of the \fBTTY\fR port \fBlogin\fR is to operate on. The use of
211 the device option can be expected to improve \fBlogin\fR performance, since
212 \fBlogin\fR does not need to call \fBttyname\fR(3C). The \fB-d\fR option is
213 available only to users whose \fBUID\fR and effective \fBUID\fR are root. Any
214 other attempt to use \fB-d\fR causes \fBlogin\fR to quietly exit.
220 \fB\fB-h\fR \fIhostname\fR [\fIterminal\fR]\fR
223 Used by \fBin.telnetd\fR(1M) to pass information about the remote host and
226 Terminal type as a second argument to the \fB-h\fR option should not start with
236 Used to pass environment variables to the login shell.
242 \fB\fB-R\fR \fIrepository\fR\fR
245 Used to specify the \fBPAM\fR repository that should be used to tell \fBPAM\fR
246 about the "\fBidentity\fR" (see option \fB-u\fR below). If no "\fBidentity\fR"
247 information is passed, the repository is not used.
253 \fB\fB-s\fR \fIservice\fR\fR
256 Indicates the \fBPAM\fR service name that should be used. Normally, this
257 argument is not necessary and is used only for specifying alternative \fBPAM\fR
258 service names. For example: "\fBktelnet\fR" for the Kerberized telnet process.
264 \fB\fB-u\fR \fIidentity\fR\fR
267 Specifies the "\fBidentity\fR" string associated with the user who is being
268 authenticated. This usually is \fBnot\fR be the same as that user's Unix login
269 name. For Kerberized login sessions, this is the Kerberos principal name
270 associated with the user.
275 The following exit values are returned:
282 Successful operation.
297 \fB\fB$HOME/.hushlogin\fR\fR
300 Suppresses login messages.
306 \fB\fB$HOME/.rhosts\fR\fR
309 Private list of trusted hostname/username combinations.
315 \fB\fB/etc/issue\fR\fR
318 Issue or project identification.
324 \fB\fB/etc/logindevperm\fR\fR
327 Login-based device permissions.
333 \fB\fB/etc/motd\fR\fR
342 \fB\fB/etc/nologin\fR\fR
345 Message displayed to users attempting to login during machine shutdown.
351 \fB\fB/etc/passwd\fR\fR
360 \fB\fB/etc/shadow\fR\fR
363 List of users' encrypted passwords.
369 \fB\fB/usr/bin/sh\fR\fR
372 User's default command interpreter.
378 \fB\fB/var/adm/lastlog\fR\fR
387 \fB\fB/var/adm/loginlog\fR\fR
390 Record of failed login attempts.
396 \fB\fB/var/adm/utmpx\fR\fR
405 \fB\fB/var/adm/wtmpx\fR\fR
414 \fB\fB/var/mail/\fR\fIyour-name\fR\fR
417 Mailbox for user \fIyour-name\fR.
423 \fB\fB/etc/default/login\fR\fR
426 Default value can be set for the following flags in \fB/etc/default/login\fR.
427 Default values are specified as comments in the \fB/etc/default/login\fR file,
428 for example, \fBTIMEZONE=EST5EDT\fR.
435 Sets the \fBTZ\fR environment variable of the shell (see \fBenviron\fR(5)).
444 Sets the \fBHZ\fR environment variable of the shell.
453 Sets the file size limit for the login. Units are disk blocks. Default is zero
463 If set, root can login on that device only. This does not prevent execution of
464 remote commands with \fBrsh\fR(1). Comment out this line to allow login by
474 Determines if login requires a non-null password.
483 Determines if login should set the \fBSHELL\fR environment variable.
492 Sets the initial shell \fBPATH\fR variable.
501 Sets the initial shell \fBPATH\fR variable for root.
510 Sets the number of seconds (between \fB0\fR and \fB900\fR) to wait before
511 abandoning a login session.
520 Sets the initial shell file creation mode mask. See \fBumask\fR(1).
529 Determines whether the \fBsyslog\fR(3C) \fBLOG_AUTH\fR facility should be used
530 to log all root logins at level \fBLOG_NOTICE\fR and multiple failed login
531 attempts at\fBLOG_CRIT\fR.
537 \fB\fBDISABLETIME\fR\fR
540 If present, and greater than zero, the number of seconds that \fBlogin\fR waits
541 after \fBRETRIES\fR failed attempts or the \fBPAM \fRframework returns
542 \fBPAM_ABORT\fR. Default is \fB20\fR seconds. Minimum is \fB0\fR seconds. No
549 \fB\fBSLEEPTIME\fR\fR
552 If present, sets the number of seconds to wait before the login failure message
553 is printed to the screen. This is for any login failure other than
554 \fBPAM_ABORT\fR. Another login attempt is allowed, providing \fBRETRIES\fR has
555 not been reached or the \fBPAM\fR framework is returned \fBPAM_MAXTRIES\fR.
556 Default is \fB4\fR seconds. Minimum is \fB0\fR seconds. Maximum is \fB5\fR
559 Both \fBsu\fR(1M) and \fBsulogin\fR(1M) are affected by the value of
569 Sets the number of retries for logging in (see \fBpam\fR(3PAM)). The default is
570 5. The maximum number of retries is 15. For accounts configured with automatic
571 locking (see \fBSECURITY\fR above), the account is locked and \fBlogin\fR
572 exits. If automatic locking has not been configured, \fBlogin\fR exits without
579 \fB\fBSYSLOG_FAILED_LOGINS\fR\fR
582 Used to determine how many failed login attempts are allowed by the system
583 before a failed login message is logged, using the \fBsyslog\fR(3C)
584 \fBLOG_NOTICE\fR facility. For example, if the variable is set to \fB0\fR,
585 \fBlogin\fR logs \fIall\fR failed login attempts.
592 See \fBattributes\fR(5) for descriptions of the following attributes:
600 ATTRIBUTE TYPE ATTRIBUTE VALUE
602 Interface Stability Committed
607 \fBcsh\fR(1), \fBexit\fR(1), \fBksh\fR(1), \fBksh93\fR(1), \fBmail\fR(1),
608 \fBmailx\fR(1), \fBnewgrp\fR(1), \fBpasswd\fR(1),
609 \fBrsh\fR(1), \fBsh\fR(1), \fBshell_builtins\fR(1), \fBtelnet\fR(1),
610 \fBumask\fR(1), \fBin.telnetd\fR(1M), \fBlogins\fR(1M),
611 \fBquota\fR(1M), \fBsu\fR(1M), \fBsulogin\fR(1M), \fBsyslogd\fR(1M),
612 \fBuseradd\fR(1M), \fBuserdel\fR(1M), \fBpam\fR(3PAM), \fBrcmd\fR(3SOCKET),
613 \fBsyslog\fR(3C), \fBttyname\fR(3C), \fBauth_attr\fR(4), \fBexec_attr\fR(4),
614 \fBhosts.equiv\fR(4), \fBissue\fR(4), \fBlogindevperm\fR(4), \fBloginlog\fR(4),
615 \fBnologin\fR(4), \fBnsswitch.conf\fR(4), \fBpam.conf\fR(4), \fBpasswd\fR(4),
616 \fBpolicy.conf\fR(4), \fBprofile\fR(4), \fBshadow\fR(4), \fBuser_attr\fR(4),
617 \fButmpx\fR(4), \fBwtmpx\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
618 \fBpam_unix_account\fR(5), \fBpam_unix_auth\fR(5), \fBpam_unix_session\fR(5),
619 \fBpam_authtok_check\fR(5), \fBpam_authtok_get\fR(5),
620 \fBpam_authtok_store\fR(5), \fBpam_dhkeys\fR(5), \fBpam_passwd_auth\fR(5),
625 \fB\fBLogin incorrect\fR\fR
629 The user name or the password cannot be matched.
635 \fB\fBNot on system console\fR\fR
639 Root login denied. Check the \fBCONSOLE\fR setting in \fB/etc/default/login\fR.
645 \fB\fBNo directory! Logging in with home=/\fR\fR
649 The user's home directory named in the \fBpasswd\fR(4) database cannot be found
650 or has the wrong permissions. Contact your system administrator.
660 Cannot execute the shell named in the \fBpasswd\fR(4) database. Contact your
661 system administrator.
667 \fB\fBNO LOGINS: System going down in\fR \fIN\fR \fBminutes\fR\fR
671 The machine is in the process of being shut down and logins have been disabled.
676 Users with a \fBUID\fR greater than 76695844 are not subject to password aging,
677 and the system does not record their last login time.
680 If you use the \fBCONSOLE\fR setting to disable root logins, you should arrange
681 that remote command execution by root is also disabled. See \fBrsh\fR(1),
682 \fBrcmd\fR(3SOCKET), and \fBhosts.equiv\fR(4) for further details.
685 The \fBpam_unix\fR(5) module is no longer supported. Similar functionality is
686 provided by \fBpam_unix_account\fR(5), \fBpam_unix_auth\fR(5),
687 \fBpam_unix_session\fR(5), \fBpam_authtok_check\fR(5),
688 \fBpam_authtok_get\fR(5), \fBpam_authtok_store\fR(5), \fBpam_dhkeys\fR(5), and
689 \fBpam_passwd_auth\fR(5).