


      LOGIN(1)                    (UNIX 5.0)                   LOGIN(1)



      NAME
           login - sign on

      SYNTAX
           login [ name [ env-var ... ]]

      DESCRIPTION
           Login initiates a user session.  It asks the user's id and
           usually his password.

           Login can be invoked by a Bourne shell user to end the
           current session and start a new one under any other user
           name.  Login is a builtin command in csh.  It insists on
           being invoked in the lowest level shell and effectively
           replaces the shell with login.

           If the user does not supply a user name as an argument,
           login asks for it.  If the user has previously used the
           passwd(1) command to establish a password, login asks for
           the password.  To prevent accidental release of the user's
           password, login turns off the character echo, if possible,
           while the password is being entered.

           With dial-up access, login may also prompt ``Dialup
           Password:''.  If so, both passwords are required for a
           successful login.  See dialups(4) for details.

           If the file /etc/nologin exists and the user is not the root
           user, the contents of /etc/nologin will be displayed and
           login will terminate.

           After a successful login, accounting files are updated and
           the user-ID, group-ID, working directory, and command
           interpreter are initialized as specified in the /etc/passwd
           file entry for the user.  The name of the command
           interpreter in use is "-", followed by the last component of
           the interpreter's pathname (i.e., -sh).  If this field in
           the password file is empty, then the default command
           interpreter, /bin/sh is used.

           If the command interpreter is /bin/sh, the commands in the
           file /etc/profile are executed followed by execution of the
           commands in the file .profile.  If the command interpreter
           is /bin/csh, the commands in the file /etc/profile.csh are
           executed followed by execution of the commands in the files
           .cshrc and .login.  The files .profile, .cshrc, and .login
           are all found in the user's home directory and are optional.

           The basic environment (see environ(5)) is initialized to:

                HOME=your-login-directory
                PATH=:/bin:/usr/bin



      Page 1                                          (73 A2 02MT REV1)






      LOGIN(1)                    (UNIX 5.0)                   LOGIN(1)



                LOGNAME=your-login-name
                TERM=terminal-type
                USER=your-login-name
                MAIL=/usr/mail/your-login-name

           The value of HOME is the home directory specified in the
           password file entry for the user.  The value of USER and
           LOGNAME are both initialized from the name given to login.
           In a similar fashion MAIL is initialized using the login
           name.

           The value of PATH is initialized as shown above to the
           default path value for most users.  Users with uid zero have
           :/etc appended to their default path.

           The name of the terminal on which login is being executed is
           used to look up the terminal type in /etc/ttytype.  If no
           terminal type can be found in this manner the value of TERM
           will be null (i.e., TERM=).




































      Page 2                                          (73 A2 02MT REV1)






      LOGIN(1)                    (UNIX 5.0)                   LOGIN(1)



           The environment may be expanded or modified by supplying
           additional arguments to login, either at execution time or
           when login requests your login name.  The arguments may take
           either the form xxx or xxx=yyy. Arguments without an equal
           sign are placed in the environment as
                Ln=xxx
           where n is a number starting at 0 and is incremented each
           time a new variable name is required.  Variables containing
           an = are placed into the environment without modification.
           If they already appear in the environment, then the new
           value replaces the older value.  There are two exceptions:
           the variables PATH and SHELL cannot be changed.  This
           prevents people, logging into restricted shell environments,
           from spawning secondary shells which aren't restricted.
           Login understands simple single character quoting
           conventions.  Typing a backslash in front of a character
           quotes it and allows the inclusion of such things as spaces
           and tabs.

           Other environment variables such as TZ or SHELL may be set
           by /etc/profile, or the /etc/profile.csh, .profile, .cshrc,
           or .login files.

      FILES
           /etc/utmp            accounting
           /etc/wtmp            accounting
           /usr/mail/your-name  mailbox for user your-name
           /etc/passwd          password file
           /etc/profile         system profile (sh)
           /etc/profile.csh     system profile (csh)
           .profile             user's login profile (sh)
           .cshrc               read at beginning of execution of csh
           .login               read after .cshrc when logging in
           /etc/dialups         list of dialup terminal names
           /etc/d_passwd        password file for dialup password
           /etc/ttytype         terminal type file
           /etc/nologin         file to prevent users other than root
           from logging in
           /etc/securetty       list of TTYs on which root can login

      SEE ALSO
           csh(1), mail(1), newgrp(1), sh(1), su(1), .cshrc(4),
           dialups(4), d_passwd(4), .login(4), nologin(4), passwd(4),
           profile(4), profile.csh(4), securetty(4), ttytype(4),
           environ(5).

      DIAGNOSTICS
           Login incorrect

                If the password supplied is not correct, login will
                prompt for the user name again.




      Page 3                                          (73 A2 02MT REV1)






      LOGIN(1)                    (UNIX 5.0)                   LOGIN(1)



           Unable to change directory to "your-login-directory"
           You are in "/" instead

                If login cannot change the working directory to your-
                login-directory, the above diagnostic is produced and
                you are left in the "/" directory.  The value of HOME
                is not changed.

           Unable to change directory to "your-login-directory"
           Unable to change directory to "/"

                If login cannot change the working directory to your-
                login-directory or / , login terminates.

           Your password has expired.  Choose a new one

                If login determines that the users password has not
                changed in the required timeframe, it execs passwd(1)
                which forces the user to enter a new password.




































      Page 4                                          (73 A2 02MT REV1)






      LOGIN(1)                    (UNIX 5.0)                   LOGIN(1)



           Bad group id.

                If login cannot change the group id of the process to
                that specified in the password file entry, login
                terminates.

           Bad user id.

                If login cannot change the user id of the process to
                that specified in the password file entry, login
                terminates.

           No shell

                The final action of login is to exec(2) the users
                shell.  If this system call fails, login terminates.

           No utmp entry. You must exec "login" from the lowest level
           "sh".

                If login cannot find an entry in the file /etc/utmp for
                the terminal on which login is running, it will
                terminate.


      BUGS
           An undocumented option, -R, is used by the remote login
           server, rlogind(1), to force login to enter an initial
           connection protocol.


























      Page 5                                          (73 A2 02MT REV1)



