]> git.saurik.com Git - apple/system_cmds.git/blob - login.tproj/login.1
6c78b23216bb07f77ec26eb0d2bc18016feb13bb
[apple/system_cmds.git] / login.tproj / login.1
1 .\" Copyright (c) 1980, 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" @(#)login.1 8.2 (Berkeley) 5/5/94
33 .\"
34 .Dd May 5, 1994
35 .Dt LOGIN 1
36 .Os BSD 4
37 .Sh NAME
38 .Nm login
39 .Nd log into the computer
40 .Sh SYNOPSIS
41 .Nm login
42 .Op Fl fp
43 .Op Fl h Ar hostname
44 .Op Ar user
45 .Sh DESCRIPTION
46 The
47 .Nm login
48 utility logs users (and pseudo-users) into the computer system.
49 .Pp
50 If no user is specified, or if a user is specified and authentication
51 of the user fails,
52 .Nm login
53 prompts for a user name.
54 Authentication of users is done via passwords.
55 .Pp
56 The options are as follows:
57 .Bl -tag -width Ds
58 .It Fl f
59 The
60 .Fl f
61 option is used when a user name is specified to indicate that proper
62 authentication has already been done and that no password need be
63 requested.
64 This option may only be used by the super-user or when an already
65 logged in user is logging in as themselves.
66 .It Fl h
67 The
68 .Fl h
69 option specifies the host from which the connection was received.
70 It is used by various daemons such as
71 .Xr telnetd 8 .
72 This option may only be used by the super-user.
73 .It Fl p
74 By default,
75 .Nm login
76 discards any previous environment.
77 The
78 .Fl p
79 option disables this behavior.
80 .El
81 .Pp
82 If the file
83 .Pa /etc/nologin
84 exists,
85 .Nm login
86 dislays its contents to the user and exits.
87 This is used by
88 .Xr shutdown 8
89 to prevent users from logging in when the system is about to go down.
90 .Pp
91 Immediately after logging a user in,
92 .Nm login
93 displays the system copyright notice, the date and time the user last
94 logged in, the message of the day as well as other information.
95 If the file
96 .Dq Pa .hushlogin
97 exists in the user's home directory, all of these messages are suppressed.
98 This is to simplify logins for non-human users, such as
99 .Xr uucp 1 .
100 .Nm Login
101 then records an entry in the
102 .Xr wtmp 5
103 and
104 .Xr utmp 5
105 files and executes the user's command interpretor.
106 .Pp
107 Login enters information into the environment (see
108 .Xr environ 7 )
109 specifying the user's home directory (HOME), command interpreter (SHELL),
110 search path (PATH), terminal type (TERM) and user name (both LOGNAME and
111 USER).
112 .Pp
113 The standard shells,
114 .Xr csh 1
115 and
116 .Xr sh 1 ,
117 do not fork before executing the
118 .Nm login
119 utility.
120 .Sh FILES
121 .Bl -tag -width /var/mail/userXXX -compact
122 .It Pa /etc/motd
123 message-of-the-day
124 .It Pa /etc/nologin
125 disallows logins
126 .It Pa /var/run/utmp
127 current logins
128 .It Pa /var/log/lastlog
129 last login account records
130 .It Pa /var/log/wtmp
131 login account records
132 .It Pa /var/mail/user
133 system mailboxes
134 .It Pa \&.hushlogin
135 makes login quieter
136 .El
137 .Sh SEE ALSO
138 .Xr chpass 1 ,
139 .Xr passwd 1 ,
140 .Xr rlogin 1 ,
141 .Xr getpass 3 ,
142 .Xr utmp 5 ,
143 .Xr environ 7 ,
144 .Sh HISTORY
145 A
146 .Nm login
147 appeared in
148 .At v6 .