LOGIN(1) COMMAND REFERENCE LOGIN(1) NAME login - sign on SYNOPSIS login [ username ] DESCRIPTION The login command is used at the beginning of each terminal session and allows the user to identify himself to the system; login may be invoked by the user as a command, or may be invoked by the system when a connection is first established. Also, login is invoked by the system when a previous user has terminated the initial shell by typing end-of-file. If login is invoked without the argument username, it asks for a user name, and, if appropriate, a password. Echoing is turned off (if possible) during the typing of the password, so that the password will not appear on the written record of the session. If a user does not complete the login successfully within a certain period of time (e.g., one minute), he is likely to be silently disconnected. After a successful login, accounting files are updated, the user is informed of the existence of mail, and the message of the day and the time of the user's last login is printed. This output to the user is suppressed if a file named .hushlogin is in the user's home directory. (This feature is mostly used to make life easier for non-human users, such as uucp(1).) The login command initializes the user and group IDs and the working directory, then executes a command interpreter (usually sh(1SH) or csh(1CSH)) according to specifications found in a password file. Argument 0 of the command interpreter is the name of the command interpreter with a leading dash ( - ) prepended. The login command also initializes the basic environment (see environ(7)) with information specifying home directory, command interpreter, command search path, terminal type (if available), user name, and mail directory. The environment is initialized to: HOME=your-login-directory SHELL=last-field-of-passwd-entry PATH=:/bin:/usr/bin TERM=first-field-of-ttytype-entry Printed 5/12/88 1
LOGIN(1) COMMAND REFERENCE LOGIN(1) 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 users logging in when the system is about to go down.) The file /etc/securetty contains a list of secure tty numbers; if this file exists, root can only log into the tty numbers listed. Users trying to log into other tty numbers as root receive the usual Login incorrect message - no hint is given that it is the tty that is wrong and not the password. The /etc/securetty file does not affect the su(1) command. Recognized by sh(1SH) and csh(1CSH) login is executed directly (without forking). FILES /etc/utmp accounting /usr/adm/wtmp accounting /usr/adm/lastlog accounting /usr/spool/mail/* mail /etc/motd message-of-the-day /etc/passwd password file /etc/ttytype ttytype file /etc/nologin stops logins .hushlogin makes login quieter /etc/securetty lists ttys that root may log in on DIAGNOSTICS Login incorrect The name or the password is bad. No Shell. No directory The /etc/passwd entry is not set up correctly for this user, and there may be no home directory as well. See a system administrator. RETURN VALUE [NO_ERRS] Command completed without error. Printed 5/12/88 2
LOGIN(1) COMMAND REFERENCE LOGIN(1) [NP_WARN] An error warranting a warning message occurred. Execution continues. [P_WARN] A system error occurred. Execution continues. See intro(2) for more information on system errors. CAVEATS An undocumented option, -r is used by the remote login server, rlogind(8N) forcing login to enter into an initial connection protocol. SEE ALSO mail(1MH), passwd(1), passwd(5), environ(7), init(8), getty(8), and shutdown(8). Printed 5/12/88 3
%%index%% na:264,67; sy:331,164; de:495,2658;3489,910; fi:4399,682; di:5081,458; rv:5539,177;6052,281; ca:6333,317; se:6650,305; %%index%%000000000152