date and time created 88/12/14 16:21:47 by marc
[unix-history] / usr / src / usr.bin / login / login.1
... / ...
CommitLineData
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.4 (Berkeley) %G%
6.\"
7.TH LOGIN 1 ""
8.UC 4
9.SH NAME
10login \- sign on
11.SH SYNOPSIS
12.B login
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]
28.SH DESCRIPTION
29The
30.I login
31command
32is used when a user initially
33signs on.
34It may also be used at any time to change
35from one user to another.
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.
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
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
61is mostly used to make life easier for non-human users, such as
62.IR uucp .
63.PP
64.I Login
65initializes the user and group IDs and the working directory,
66then executes a command interpreter (usually
67.IR csh (1))
68according to specifications found in a password file.
69Argument 0 of the command interpreter is
70the name of the command interpreter with
71a leading dash (\*(lq\-\*(rq).
72.PP
73Login also modifies the
74environment
75.IR environ (7)
76with information specifying home directory, command interpreter, terminal
77type (if available) and user name.
78The `\-p' argument causes the remainder of the environment to be preserved,
79otherwise any previous environment is discarded.
80.PP
81If the file /etc/nologin exists,
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).
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
101.IR telnetd (8C)
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.
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
126.SH "SEE ALSO"
127mail(1), passwd(1), rlogin(1), getpass(3), passwd(5), utmp(5), environ(7),
128init(8), getty(8), shutdown(8),
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.
136.SH BUGS
137An undocumented option,
138.B \-r
139is used by the remote login server,
140.IR rlogind (8)
141to force
142.I login
143to enter into an initial connection protocol.