LOGIN(1) — USER COMMANDS
NAME
login − log in to the system
SYNOPSIS
login [ −p ] [ username ]
DESCRIPTION
login signs username on to the system initially; login may also be used at any time to change from one userID 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).)
When successful, login updates accounting files, 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 are 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 /usr/bin/sh or /usr/bin/csh) 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 directly 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(1). For example, if the file contains:
console"/etc/getty Console-9600"sunon secure
tty00"/etc/getty Console-9600"sunon
...
root can only log in directly on the console. See ttytab(5) for a discussion of “secure” and other init(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.
OPTIONS
−p Preserve any existing environment variables and their values; otherwise the previous environment is discarded.
FILES
/etc/utmp accounting
/var/adm/wtmp accounting
/var/adm/lastlog time of last login
/etc/ttytab terminal types
/usr/ucb/quota quota check
/var/spool/mail/∗ mail
/etc/motd message-of-the-day
/etc/passwd password file
/etc/nologin stop login, print message
~/.hushlogin makes login quieter
/usr/bin/sh
/usr/bin/csh
.login
.profile
SEE ALSO
csh(1), mail(1), passwd(1), rlogin(1C), sh(1), uucp(1C), environ(5V), passwd(5), utmp(5), getty(8), init(8), shutdown(8)
DIAGNOSTICS
Login incorrect
If the name or the password is bad (or mistyped).
No Shell
cannot open password file
no directory
Ask your system administrator for assistance.
Sun Release 4.0 — Last change: 5 July 1989