login(1) CLIX login(1)
NAME
login - Identifies a user and begins a terminal session
SYNOPSIS
login [username [env-var ... ]]
DESCRIPTION
The login command identifies a user to the system and is used at the
beginning of each terminal session. It may be run as a command or by the
system when a connection is first established. Also, it is run by the
system when a previous user has terminated the initial shell by keying in
a <Ctrl-D> sequence to indicate an end-of-file.
If login is run as a command, it must replace the initial command
interpreter. This is accomplished by keying in the following from the
initial shell:
exec login
If the user does not specify a username, login asks for a username and, if
appropriate, a password. Echoing is turned off (where possible) while the
password is keyed in, so it does not appear on the written record of the
session.
At some installations, an option may be used that requires the user to key
in a second (dialup) password. This occurs only for dialup connections,
and is prompted by the following message:
dialup password:
Both passwords are required for a successful login.
If the user does not complete the login successfully within a certain
period of time (for example, one minute), the user is silently
disconnected.
After a successful login, the system performs the following functions:
⊕ Updates accounting files.
⊕ Executes the /etc/profile file.
⊕ Displays the message-of-the-day (if it exists).
⊕ Initializes the user ID and the group ID, places the user in his or her
home directory, and executes the default command interpreter. These
specifications are found in the user's etc/passwd entry.
2/94 - Intergraph Corporation 1
login(1) CLIX login(1)
⊕ Executes the .profile file in the user's home directory (if it exists).
The name of the command interpreter is -, followed by the last component
of the interpreter's pathname (that is, -sh). If this field in the user's
/etc/passwd entry is empty, then the default command interpreter, /bin/sh
is used. If this field in the user's /etc/passwd entry is *, then the
named directory becomes the root directory, the starting point for path
searches for pathnames beginning with root (/). At that point login is
re-executed at the new level, which must have its own root structure,
including the following directories and files:
bin/ksh
bin/login
etc/group
etc/passwd
etc/utmp
shlib/shared-libraries
Also, in the user's /etc/passwd entry, the home directory should be root
(/).
The user's basic login environment is initialized to the following:
HOME=login-directory
PATH=:/bin:/usr/bin
SHELL=last-field-of-passwd-entry
MAIL=/usr/mail/login-name
TZ=timezone-specification
The user may expand or modify the environment by supplying additional
environment variables (env-var arguments) to login, either at execution
time or when login requests the user's login name. These arguments may
take either the form xxx or xxx=yyy. Arguments without an = are placed in
the environment as Ln=xxx, where n is a number starting at 0 and
incremented each time a new variable name is required. Arguments
containing an = are placed into the environment without modification. If
they already appear in the environment, then they replace the older value.
There are two exceptions: the variables PATH and SHELL cannot be changed.
This prevents people who are 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 allows the
inclusion of such things as spaces and tabs.
If the file /etc/nologin exists, login displays its contents on the user's
terminal and exits. This can be used by the system administrator to stop
users logging in when the system is about to go down.
2 Intergraph Corporation - 2/94
login(1) CLIX login(1)
FILES
/etc/utmp Accounting file.
/etc/wtmp Accounting file.
/usr/mail/username Mailbox file for user username.
/etc/motd Message-of-the-day file.
/etc/passwd Password file.
/etc/profile System profile file.
.profile User's login profile file.
DIAGNOSTICS
The login command displays the following messages:
1. The username or the password cannot be matched:
login incorrect
2. Consult a UNIX system administrator:
No shell
Cannot open password file
No directory
3. The user attempted to execute login as a command without using the
shell's exec internal command or from other than the initial shell:
No utmp entry. You must exec "login" from the lowest level "sh"
4. The user limit of the system has been reached:
Too many users logged on. Try again later.
EXIT VALUES
This command exits with a value of 0 if successful. If unsuccessful, it
exits with a nonzero value.
RELATED INFORMATION
Commands: mail(1), newgrp(8), sh(1), su(8), getty(8)
2/94 - Intergraph Corporation 3
login(1) CLIX login(1)
Files: passwd(4), profile(4)
Miscellany: environ(4)
4 Intergraph Corporation - 2/94