login(1) —
NAME
login − sign on
SYNOPSIS
login [ −P prompt ] [name [env-var ...]]
DESCRIPTION
The login command is used at the beginning of each terminal session and allows you to identify yourself to the system. It may be invoked as a command or by the system when a connection is first established. Also, it is invoked by the system when a previous user has terminated the initial shell by typing a CTRL-D to indicate an “end-of-file.”
The −P prompt option allows the user to specify a particular login prompt, instead of the default "login: "
If login is invoked as a command, it must replace the initial command interpreter. This is accomplished by typing:
exec login
from the initial shell.
login asks for your user name (if not supplied as an argument), and, if appropriate, your password. Echoing is turned off (where possible) during the typing of your password, so it will not appear on the written record of the session.
If you make a mistake in the login procedure you will receive the message:
Login incorrect
and a new login prompt will appear. If you make five incorrect login attempts, all five may be logged in /usr/adm/loginlog (if it exists) and the line will be dropped.
If you do not complete the login successfully within a certain period of time (e.g., 1 minute), you will probably be silently disconnected.
After a successful login, the user ID, the group IDs, the additional groups (if any), the working directory, and the command interpreter (usually sh(1) or csh(1)) are initialized. If the shell /bin/sh is running, accounting files are updated, the procedure /etc/profile is performed, the message-of-the-day (if any) is printed, and the file .profile in the working directory is executed, if it exists. If the shell /bin/csh is running, the .login and .cshrc files in the working directory are executed, if they exist. These specifications are found in the /etc/passwd file entry for the user. The name of the command interpreter is − followed by the last component of the interpreter’s path name (i.e., −sh). If this field in the password file is empty, then the default command interpreter /bin/sh is used. If this field is then the named directory becomes the root directory, the starting point for path searches for path names beginning with a slash (/). At that point, login is re-executed at the new level which must have its own root structure, including /bin/login and /etc/passwd.
The basic environment is initialized to:
LOGNAME=your-login-name
HOME=your-login-directory
SHELL=last-field-of-passwd-entry
PATH=:/bin:/usr/bin
HZ=system-clock-rate-in-hertz
TZ=timezone-specification
TERM=terminal-type (from /etc/ttytype)
MAIL=/usr/mail/your-login-name
(If the directory /usr/ucb is present, it will also be included in the PATH.) Additionally, if specified in the file /etc/default/login, each of the following localization variables will be set to the value specified in the file:
LC_ALL
LC_COLLATE
LC_CTYPE
LC_MESSAGES
LC_MONETARY
LC_NUMERIC
LC_TIME
LANG
NLSPATH
CHRCLASS
The environment may be expanded or modified by supplying additional arguments to login, either at execution time or when login requests your login name. The arguments may take either the form xxx or xxx=yyy. Arguments without an equal sign are placed in the environment as:
Ln=xxx
where n is a number starting at 0 and is incremented each time a new variable name is required. Variables containing an = are placed into the environment without modification. If they already appear in the environment, then they replace the older value. There are exceptions. The variables HOME, PATH, SHELL, MAIL, IFS, TZ, HZ, CDPATH, and LOGNAME cannot be changed. This prevents people, logging into restricted shell environments, from spawning secondary shells which are not restricted. Both login and getty understand simple single-character quoting conventions. Typing a backslash in front of a character quotes it and allows the inclusion of such things as spaces and tabs.
FILES
/etc/default/loginfile containing default parameters for login
/etc/utmpaccounting
/etc/wtmpaccounting
/usr/mail/your-namemailbox for user your-name
/usr/adm/loginlogrecord of failed login attempts
/etc/ttytypespecifies terminal type for each tty
/etc/motdmessage-of-the-day
/etc/passwdpassword file
/etc/profilesystem profile (/bin/sh only)
.profileuser’s login profile (/bin/sh only)
.loginuser’s login profile (/bin/csh only)
.cshrcuser’s csh settings (/bin/csh only)
SEE ALSO
csh(1), mail(1), sh(1), newgrp(1M), su(1M), loginlog(4), passwd(4), profile(4), environ(5).
DIAGNOSTICS
login incorrect if the user name or the password cannot be matched. No shell, cannot open password file, or no directory: the password file (/etc/passwd), cannot be found or has a field missing. No utmp entry. If you attempted to execute login as a command without using the shell’s exec internal command or attempted to execute login as a command from a shell other than the initial shell, you must execute login from the lowest level shell.
NOTES
The file /etc/default/login contains special login information including the flag PASSREQ. When PASSREQ is set to YES (PASSREQ=YES), users will be required to have a password. When a user without a password logs in and PASSREQ=YES, the user will be forced to add a password before the user is allowed access to the system. One exception to this requirement is if password aging is turned on for the user and the NULL password has not been aged. In this case, the user will be allowed to access the system without a password until the NULL password has been aged, or until the root user forces the password to be aged (passwd −f command).
ADDED VALUE
This entry, supplied by SunSoft, Inc., contains enhancements to UNIX System V.
\*U — Version 1.0