add protection against masquerading Kerberos server
[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.\"
c61c79a1 5.\" @(#)login.1 6.6 (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
7ed14798
MK
13[
14.B \-p
15] [ username ]
16.br
17.B login
18[
19.B \-p
20] [
21.B \-h
22hostname
23] [
24.B \-f
25] [
26username
27]
55890414
KM
28.SH DESCRIPTION
29The
30.I login
31command
32is used when a user initially
7ed14798
MK
33signs on.
34It may also be used at any time to change
55890414 35from one user to another.
7ed14798
MK
36This case is the one summarized first above and described here.
37See \*(lqHow to Get Started\*(rq for how to connect initially.
38The invocation of
39.I login
40for initial sign-on
41is made by a system program or server using the latter form of the command
42and is described below.
55890414
KM
43.PP
44If
45.I login
46is invoked without an argument,
47it asks for a user name, and, if
48appropriate, a password.
49Echoing is turned off (if possible) during the typing of the password,
50so it will not appear on the written record of the
51session.
52.PP
53After a successful login,
54accounting files are updated and
55the user is informed of the
678ce1ab
MK
56existence of mail.
57The message of the day is printed,
58as is the time of his last login.
59Both are suppressed if he has a \*(lq.hushlogin\*(rq
60file in his home directory; this
55890414 61is mostly used to make life easier for non-human users, such as
678ce1ab 62.IR uucp .
55890414
KM
63.PP
64.I Login
65initializes the user and group IDs and the working directory,
66then executes a command interpreter (usually
678ce1ab 67.IR csh (1))
55890414 68according to specifications found in a password file.
678ce1ab
MK
69Argument 0 of the command interpreter is
70the name of the command interpreter with
71a leading dash (\*(lq\-\*(rq).
55890414 72.PP
06ae098a 73Login also modifies the
55890414 74environment
38259b3c 75.IR environ (7)
55890414
KM
76with information specifying home directory, command interpreter, terminal
77type (if available) and user name.
678ce1ab
MK
78The `\-p' argument causes the remainder of the environment to be preserved,
79otherwise any previous environment is discarded.
55890414 80.PP
678ce1ab 81If the file /etc/nologin exists,
55890414
KM
82.I login
83prints its contents on the user's terminal and exits. This is
84used by
85.IR shutdown (8)
86to stop users logging in when the system is about to go down.
87.PP
88Login is recognized by
89.IR sh (1)
90and
91.IR csh (1)
92and executed directly (without forking).
7ed14798
MK
93.PP
94There are several additional options to
95.I login
96for use at initial login.
97With one exception, these options are available only to the superuser.
98The
99.B \-h
100option is used by
e2be9dca 101.IR telnetd (8)
7ed14798
MK
102and other servers to list the host from which
103the connection was received.
104The
105.B \-f
106option is used with a username on the command line
107to indicate that proper authentication has already been done
108and that no password need be requested.
109This option may be used by the superuser
110or by the user specified on the command line.
55890414
KM
111.SH FILES
112.ta \w'/usr/spool/mail/*\ \ 'u
113/etc/utmp accounting
114.br
115/usr/adm/wtmp accounting
116.br
117/usr/spool/mail/* mail
118.br
119/etc/motd message-of-the-day
120.br
121/etc/passwd password file
122.br
123/etc/nologin stops logins
124.br
125\&.hushlogin makes login quieter
55890414 126.SH "SEE ALSO"
e7f3a960
KB
127mail(1), passwd(1), rlogin(1), getpass(3), passwd(5), utmp(5), environ(7),
128init(8), getty(8), shutdown(8),
55890414
KM
129.SH DIAGNOSTICS
130\*(lqLogin incorrect,\*(rq
131if the name or the password is bad.
132.br
133\*(lqNo Shell\*(rq, \*(lqcannot open password file\*(rq,
134\*(lqno directory\*(rq:
135consult a programming counselor.