| 1 | .\" Copyright (c) 1980 Regents of the University of California. |
| 2 | .\" All rights reserved. The Berkeley software License Agreement |
| 3 | .\" specifies the terms and conditions for redistribution. |
| 4 | .\" |
| 5 | .\" @(#)login.1 6.1 (Berkeley) %G% |
| 6 | .\" |
| 7 | .TH LOGIN 1 "" |
| 8 | .UC 4 |
| 9 | .SH NAME |
| 10 | login \- sign on |
| 11 | .SH SYNOPSIS |
| 12 | .B login |
| 13 | [ \-p ] [ username ] |
| 14 | .SH DESCRIPTION |
| 15 | The |
| 16 | .I login |
| 17 | command |
| 18 | is used when a user initially |
| 19 | signs on, or it may be used at any time to change |
| 20 | from one user to another. |
| 21 | The latter case is the one summarized above and |
| 22 | described here. |
| 23 | See \*(lqHow to Get Started\*(rq for how to dial up initially. |
| 24 | .PP |
| 25 | If |
| 26 | .I login |
| 27 | is invoked without an argument, |
| 28 | it asks for a user name, and, if |
| 29 | appropriate, a password. |
| 30 | Echoing is turned off (if possible) during the typing of the password, |
| 31 | so it will not appear on the written record of the |
| 32 | session. |
| 33 | .PP |
| 34 | After a successful login, |
| 35 | accounting files are updated and |
| 36 | the user is informed of the |
| 37 | existence of mail, |
| 38 | and |
| 39 | the message of the day is printed, |
| 40 | as is the time he last logged in (unless he has a \*(lq.hushlogin\*(rq |
| 41 | file in his home directory \- this |
| 42 | is mostly used to make life easier for non-human users, such as |
| 43 | .IR uucp ). |
| 44 | .PP |
| 45 | .I Login |
| 46 | initializes the user and group IDs and the working directory, |
| 47 | then executes a command interpreter (usually |
| 48 | .IR sh (1)) |
| 49 | according to specifications found in a password file. |
| 50 | Argument 0 of the command interpreter is \*(lq\-sh\*(rq, or |
| 51 | more generally the name of the command interpreter with |
| 52 | a leading dash (\*(lq\-\*(rq) prepended. |
| 53 | .PP |
| 54 | Login also modifies the |
| 55 | environment |
| 56 | .IR environ (7) |
| 57 | with information specifying home directory, command interpreter, terminal |
| 58 | type (if available) and user name. |
| 59 | The `-p' argument causes the environment to be preserved from getty. |
| 60 | .PP |
| 61 | If the file /etc/nologin exists |
| 62 | .I login |
| 63 | prints its contents on the user's terminal and exits. This is |
| 64 | used by |
| 65 | .IR shutdown (8) |
| 66 | to stop users logging in when the system is about to go down. |
| 67 | .PP |
| 68 | Login is recognized by |
| 69 | .IR sh (1) |
| 70 | and |
| 71 | .IR csh (1) |
| 72 | and executed directly (without forking). |
| 73 | .SH FILES |
| 74 | .ta \w'/usr/spool/mail/*\ \ 'u |
| 75 | /etc/utmp accounting |
| 76 | .br |
| 77 | /usr/adm/wtmp accounting |
| 78 | .br |
| 79 | /usr/spool/mail/* mail |
| 80 | .br |
| 81 | /etc/motd message-of-the-day |
| 82 | .br |
| 83 | /etc/passwd password file |
| 84 | .br |
| 85 | /etc/nologin stops logins |
| 86 | .br |
| 87 | \&.hushlogin makes login quieter |
| 88 | .SH "SEE ALSO" |
| 89 | init(8), getty(8), mail(1), passwd(1), passwd(5), environ(7), |
| 90 | shutdown(8) |
| 91 | .SH DIAGNOSTICS |
| 92 | \*(lqLogin incorrect,\*(rq |
| 93 | if the name or the password is bad. |
| 94 | .br |
| 95 | \*(lqNo Shell\*(rq, \*(lqcannot open password file\*(rq, |
| 96 | \*(lqno directory\*(rq: |
| 97 | consult a programming counselor. |
| 98 | .SH BUGS |
| 99 | An undocumented option, |
| 100 | .B \-r |
| 101 | is used by the remote login server, |
| 102 | .IR rlogind (8C) |
| 103 | to force |
| 104 | .I login |
| 105 | to enter into an initial connection protocol. |