LOGIN(1) — Unix Programmer’s Manual
NAME
login − sign on
SYNOPSIS
login [ username ]
DESCRIPTION
The login command is used when a user initially signs on, or it may be used at any time to change from one user to another. The latter case is described here. See “Getting Started” in “Introduction” of the UNIX User’s Reference Manual for information on how to dial up initially.
If login is invoked without an argument, it prompts for a user name, and if appropriate, a password. If possible, echoing is turned off during the entry of the password, so that it will not appear on the written record of the session.
After a successful login, accounting files are updated. The user is informed of the existence of mail and the message of the day is printed. In addition, the time the user last logged in is printed, unless there is a “.hushlogin” file in his or her home directory. (This is primarily for the benefit of uucp, etc.)
Login initializes the user and group IDs and the working directory, then executes a command interpreter (usually sh(1)) according to specifications found in a password file. Argument 0 of the command interpreter is −sh; or more generally, the name of the command interpreter preceded by a leading dash (−).
Login also initializes the environment (environ(7)), specifying home directory, command interpreter, terminal type (if available) and user name.
OPTIONS
−d Used to indicate desktop logins on graphics workstations. If −d is specified, login will start up a desktop manager instead of the user’s login shell. Login searches for a desktop manager in the file .dm in the user’s home directory; if that does not exist or is not executable, it tries /usr/lib/dm. Finally, if /usr/lib/dm does not exist or is not executable, /bin/dm ( dm(1) ) is used as the desktop manager. This scheme allows individual users to provide their own desktop managers (in .dm) or a means to provide a system wide desktop manager (in /usr/lib/dm).
−r Used by the remote login daemon, rlogind(8C), to force login to enter into an initial connection protocol.
If the file /etc/nologin exists, login disables any further logins, displays any message it contains, and exits. This is used by shutdown(8) to stop users from logging in when the system is about to go down.
Login is recognized by sh(1) and csh(1) and is executed directly (without forking).
FILES
/etc/utmpaccounting
/usr/adm/wtmpaccounting
/usr/spool/mail/∗mail
/etc/motdmessage-of-the-day
/etc/passwdpassword file
/etc/nologinstops logins
.hushloginmakes login quieter
/etc/securettylists ttys that root may log in on
SEE ALSO
init(8), getty(8), dm(1), mail(1), passwd(1), passwd(5), environ(7), shutdown(8)
DIAGNOSTICS
“Login incorrect,” if the name or the password is invalid.
“No shell,” “Cannot open password file,” “No directory”: consult a system expert.
4th Berkeley Distribution — 1 August 1985