add offsets, new fields
[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.\"
678ce1ab 5.\" @(#)login.1 6.2 (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
678ce1ab
MK
37existence of mail.
38The message of the day is printed,
39as is the time of his last login.
40Both are suppressed if he has a \*(lq.hushlogin\*(rq
41file in his home directory; this
55890414 42is mostly used to make life easier for non-human users, such as
678ce1ab 43.IR uucp .
55890414
KM
44.PP
45.I Login
46initializes the user and group IDs and the working directory,
47then executes a command interpreter (usually
678ce1ab 48.IR csh (1))
55890414 49according to specifications found in a password file.
678ce1ab
MK
50Argument 0 of the command interpreter is
51the name of the command interpreter with
52a leading dash (\*(lq\-\*(rq).
55890414 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.
678ce1ab
MK
59The `\-p' argument causes the remainder of the environment to be preserved,
60otherwise any previous environment is discarded.
55890414 61.PP
678ce1ab 62If the file /etc/nologin exists,
55890414
KM
63.I login
64prints its contents on the user's terminal and exits. This is
65used by
66.IR shutdown (8)
67to stop users logging in when the system is about to go down.
68.PP
69Login is recognized by
70.IR sh (1)
71and
72.IR csh (1)
73and executed directly (without forking).
74.SH FILES
75.ta \w'/usr/spool/mail/*\ \ 'u
76/etc/utmp accounting
77.br
78/usr/adm/wtmp accounting
79.br
80/usr/spool/mail/* mail
81.br
82/etc/motd message-of-the-day
83.br
84/etc/passwd password file
85.br
86/etc/nologin stops logins
87.br
88\&.hushlogin makes login quieter
55890414 89.SH "SEE ALSO"
38259b3c 90init(8), getty(8), mail(1), passwd(1), passwd(5), environ(7),
678ce1ab 91shutdown(8), rlogin(1c)
55890414
KM
92.SH DIAGNOSTICS
93\*(lqLogin incorrect,\*(rq
94if the name or the password is bad.
95.br
96\*(lqNo Shell\*(rq, \*(lqcannot open password file\*(rq,
97\*(lqno directory\*(rq:
98consult a programming counselor.
38259b3c
KM
99.SH BUGS
100An undocumented option,
101.B \-r
102is used by the remote login server,
103.IR rlogind (8C)
104to force
105.I login
106to enter into an initial connection protocol.
678ce1ab
MK
107.B \-h is used by
108.IR telnetd (8C)
109and other servers to list the host from which
110the connection was received.