NAME
login - Signs the user on to the system
SYNOPSIS
login [-p] [user]
login [-p] [-h host] [-f user]
The login command is used when a user initially signs on to
the system. It is also used to change from one user to
another.
FLAGS
With one exception, these flags are available only to the
superuser.
-h host
Used by telnetd(8) and other servers to list the host
from which the connection was received.
-f user
Used with a username user on the command line to indi-
cate that proper authentication was already done and
that no password needs to be requested.
-p Causes the remainder of the environment to be preserved;
otherwise, any previous environment is discarded.
DESCRIPTION
The invocation of login for initial sign-on is made by a
system program or server using the latter form of the com-
mand and is described later.
If login is invoked without an argument, it asks for a user-
name, and, if appropriate, a password. Echoing is turned
off (if possible) during the entering of the password, so it
will not appear on the written record of the session.
After a successful login, accounting files are updated. You
are informed of the existence of mail, and the message of
the day and the time of last login are displayed. The mail
message, the message of the day, and the last login time are
suppressed if there is a .hushlogin file in the home direc-
tory; this is mostly used to make life easier for users such
as uucp.
The login command initializes the user and group IDs and the
working directory, then executes a command interpreter
according to specifications found in the password file.
Argument 0 (zero) of the command interpreter is the name of
the command interpreter with a leading - (dash).
The login command also modifies the environment with infor-
mation specifying home directory, command interpreter, ter-
minal type (if available), and username.
If the file /etc/nologin exists, login prints its contents
on your terminal and exits. This is used by shutdown to stop
users from logging in when the system is about to go down.
Login is recognized by sh and csh and executed directly
(without forking).
FILES
/var/adm/utmp
Contains user and accounting information.
/var/adm/wtmp
Contains login history.
/usr/adm/lastlog
Contains last login time stamps.
/var/spool/mail/*
Mail directory.
/etc/motd Message of the day.
/etc/passwd
Contains user information.
/etc/nologin
Stops logins.
.hushlogin Supresses mail notification, message of the day,
and last login time.
DIAGNOSTICS
Login incorrect
The username or the password is invalid.
No Shell, cannot open password file, no directory,
Consult your system administrator.
RELATED INFORMATION
Commands: init(8), getty(8), mail(1)/binmail(1),
mailx(1)/Mail(1), passwd(1)/chfn(1)/chsh(1), rlogin(1),
shutdown(8).
Functions: getpass(3).
Files: passwd(4), utmp(4).
Acknowledgement and Disclaimer