LOGIN(1,C) AIX Commands Reference LOGIN(1,C)
-------------------------------------------------------------------------------
login
PURPOSE
Logs you in to the system.
SYNTAX
+-----------+ 1
login ---| |---|
+- -r node -+
-----------------
1 This command is not normally entered on the command line.
DESCRIPTION
The login program logs you into the system. Its primary functions are:
o To validate your password
o To make the required accounting and log entries
o To set up your processing environment
o To run the command interpreter that is specified in the password file,
which is usually the sh program.
A logger process, which initially runs the getty program, is started for each
enabled port. The getty program reads a login name and sets work station modes
(see "getty"). Then it runs the login program, which may ask you for a
password. If you do not have a password, you will be immediately logged in.
Your login attempt can fail for the following reasons:
o Your login name/password pair does not match an entry in the password file.
o Your password has expired. This can happen if your system requires that
you change your password after a specified number of days. If your
password expires, the login program, instead of letting you log in runs the
passwd command. (For more information, see "passwd, chfn, chsh.") After
you change your password, you can attempt to log in again.
o The system has reached the limit of simultaneously logged-in users. Each
AIX kernel sets a limit on the number of concurrent log ins by
non-privileged users; this limit may be one. A privileged user is a user
who has a user ID between 0 and 20. A privileged user can log in at any
time.
In one special case, the login program does not ask for a user name and
password pair: when the login port is the console and the file /etc/autolog
Processed November 8, 1990 LOGIN(1,C) 1
LOGIN(1,C) AIX Commands Reference LOGIN(1,C)
contains a valid user name. In this case, the login program automatically
creates a login session for that user. Other processing by the login program
proceeds normally.
When a user logs in successfully, the login program makes entries in the file
/etc/utmp, which contains a list of users logged into the system. This program
also makes entries in the file /usr/adm/wtmp, if it exists, which is used for
accounting. When an invalid login is attempted (due to an incorrect login name
or password), the login program makes entries in the /etc/.ilog file.
After you log in to the system, the login program lists the system message of
the day (which is stored in the /etc/motd file) and informs you if you have
mail. These messages are suppressed if there is a .hushlogin file in your home
directory. If a user file size limit has been specified in the passwd file,
the limit is set with ulimit system call. When you log in as user root or su
and the /etc/.ilog file is not empty, you see a message advising the you to
check the /etc/.ilog file for a record of unsuccessful login attempts.
The login program sets the LOGNAME and HOME environment variables from
information in the password file. Environment variables (such as those
specified in /etc/environment) that are inherited from the getty and init
commands are kept. You may expand or modify the environment by supplying
additional parameters to the login program when it requests your login name.
These may take the form xxx or xxx=yyy. Parameters without an equal sign are
placed in the environment as Lnum=xxx, where num is a number starting at 0 and
incremented each time a new variable name is required. Parameters containing
an equal sign are placed into the environment without modification. If they
already exist, the new assignment replaces the older value. There are two
exceptions: you cannot change the shell variables PATH and SHELL. (This
restriction prevents people logging into restricted environments from spawning
secondary shells that are not restricted.) Both the login and getty understand
simple single-character quoting conventions. Typing a \ (backslash) in front
of a character quotes it and allows you to include such items as spaces and tab
characters.
Note: The default language is selected from /etc/ports.
The login command changes the current directory to your HOME directory, changes
the ownership of the port (work station) to the user logging in, sets the user-
and group-IDs of the process, and then runs the program specified for the user
in the password file, which is usually the shell (/bin/sh). The login program
calls this program with a name consisting of a - (minus) followed by the last
segment of its path name. An instance of the shell can therefore determine
from its invocation name whether it is a login shell or a subshell.
The /etc/passwd file entry may include parameters that are always passed to the
shell program. For more details, see the passwd file in AIX Operating System
Technical Reference.
If the file /etc/nologin exists, the login program prints its contents on your
terminal and exits. This is used by the shutdown program to stop users from
logging in when the system is about to go down.
Processed November 8, 1990 LOGIN(1,C) 2
LOGIN(1,C) AIX Commands Reference LOGIN(1,C)
FLAGS
-r node Identifies the login as a remote login and specifies the node
requesting the login.
FILES
/etc/utmp Accounting file.
/usr/adm/wtmp Accounting file.
/etc/.ilog Accounting file.
/etc/autolog Login ID for automatic login.
/usr/motd Message of the day.
/etc/passwd Password file.
.hushlogin Suppresses login messages.
/etc/nologin Stops logins.
RELATED INFORMATION
See the following commands: "adduser, users," "csh," "getty," "init,
telinit," "passwd, chfn, chsh," and "pstart, penable, pshare, pdelay,"
"Restricted Shell," "sa," "sh, Rsh," and "su."
See the passwd and utmp files in AIX Operating System Technical Reference.
See the discussion of login sessions in Managing the AIX Operating System.
Processed November 8, 1990 LOGIN(1,C) 3