
login(1) | login(1) |
NAME
login - sign on; start terminal session
SYNOPSIS
login [name
DESCRIPTION
The login command is used at the beginning of each terminal session to properly identify a prospective user. login can be invoked as a user command or by the system as an incoming connection is established. login can also be invoked by the system when a previous user shell terminates but the terminal does not disconnect.
If login is invoked as a command, it must replace the initial command interpreter (the user's login shell). This is accomplished with the shell command
exec login
The user's login name is requested, if it is not speci®ed on the command line, and the corresponding password is obtained, if required, with the following prompts:
login:
Password:
Terminal echo is turned off (where possible) during password entry to prevent written records of the pass- word. If the account does not have a password, and the authentication pro®le for the account requires one, login invokes pam_chauthtok() to establish one for the account. On a trusted system, login displays the last successful and unsuccessful login times and terminal devices.
As a security precaution, some installations use an option that requires a second "dialup" password. This occurs only for dialup connections, and is requested with the prompt:
dialup password:
Both passwords must be correct for a successful login (see dialups(4) for details on dialup security).
If password aging is activated, the user's password may have expired. pam_chauthtok() is invoked to change the password. In an untrusted environment, the user is required to
After three unsuccessful login attempts, a HANGUP signal is issued. If a login is not successfully completed within a certain period of time (for example, one minute), the terminal is silently disconnected.
After a successful login, the accounting ®les are updated, user and group IDs, group access list, and working directory are initialized, and the user's command interpreter (shell) is determined from corresponding user entries in the ®les /etc/passwd and /etc/logingroup (see passwd(4) and group(4)). If /etc/passwd does not specify a shell for the user name, /usr/bin/sh is used by default. login then forks the appropriate shell by using the last component of the shell path name preceded by a - (for example,
For example, if the user login shell is the Bourne, Korn, or POSIX shell (see
If the command name ®eld is *, a chroot() to the directory named in the directory ®eld of the entry is performed. At that point, login is
For the normal user, the basic environment variables (see environ(5)) are initialized to:
HOME=login_directory
LOGNAME=login_name
MAIL=/var/mail/login_name
PATH=:/usr/bin
SHELL=login_shell
l
− 1 − | Section 1−461 |