login signs username on to the system initially; login may also be used at any time to change from one user ID to another.
When used with no argument, login requests a user name and password (if appropriate). Echoing is turned off (if possible) while typing the password. Note: the number of significant characters in a password is 8. See passwd.1
If password aging is enabled and the password corresponding to the user name has expired, the user will be prompted for a new password. The user has to successfully modify his password for login to proceed. See passwd.1
When successful, login updates accounting files, prints disk usage and limits (by running quota.1 prints the message of the day, informs you of the existence of any mail, and displays the time you last logged in. None of these messages is printed if there is a .hushlogin file in your home directory. This is mostly used to make life easier for nonhuman users, such as uucp.1c
login initializes the user and group IDs and the working directory, then starts a command interpreter shell (usually either sh.1 or csh.1 according to specifications found in the file /etc/passwd. Argument 0 of the command interpreter is the name of the command interpreter with a leading dash (`-') prepended.
login also modifies the environment (environ(5V)) with information specifying home directory, command interpreter, terminal-type (if available) and username. The -p argument preserves the remainder of the environment, otherwise any previous environment is discarded.
The super-user
root
may only log in on those terminals marked as
``secure'' in the
/etc/ttytab
file. Otherwise, the super-user must log in as an ordinary user and become
super-user using
su.1v
For example, if the file contained:
console "/etc/getty Console-9600" sun on secure tty00 "/etc/getty Console-9600" sun on ...
the super-user could only log in directly on the console. See ttytab.5 for a discussion of ``secure'' and other getty.8 options used in /etc/ttytab.
If the file /etc/nologin exists, login prints its contents on the user's terminal and exits. This is used by shutdown.8 to stop logins when the system is about to go down.
The login command, recognized by sh.1 and csh.1 is executed directly (without forking), and terminates that shell. To resume working, you must log in again.
login times out and exits if its prompt for input is not answered within a reasonable time.
When the Bourne shell (sh) starts up, it reads a file called .profile from your home directory (that of the username you use to log in). When the C shell (csh) starts up, it reads a file called .cshrc from your home directory, and then reads a file called .login.
The shells read these files only if they are owned by the person logging in.
The following options are undocumented, and not intended
for the user.
The
-r
option is used by the remote login server,
rlogind.8c
to force
login
to enter into an initial connection protocol.
-h
is used by
telnetd.8c
and other servers to list the host from which the connection was
received.
The following warnings apply when login account names contain characters outside the range of 7-bit ASCII:
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97