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