]> git.saurik.com Git - apple/system_cmds.git/blob - login.tproj/login.1
system_cmds-433.8.tar.gz
[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 pq
43 .Op Fl h Ar hostname
44 .Op Ar user
45 .Nm login
46 .Fl f
47 .Op Fl lpq
48 .Op Fl h Ar hostname
49 .Op Ar user Op Ar prog Op Ar args...
50 .Sh DESCRIPTION
51 The
52 .Nm login
53 utility logs users (and pseudo-users) into the computer system.
54 .Pp
55 If no user is specified, or if a user is specified and authentication
56 of the user fails,
57 .Nm login
58 prompts for a user name.
59 Authentication of users is done via passwords.
60 .Pp
61 The options are as follows:
62 .Bl -tag -width Ds
63 .\" ==========
64 .It Fl f
65 The
66 .Fl f
67 option is used when a user name is specified to indicate that proper
68 authentication has already been done and that no password need be
69 requested.
70 This option may only be used by the super-user or when an already
71 logged in user is logging in as themselves.
72 .Pp
73 With the
74 .Fl f
75 option, an alternate program (and any arguments) may be run instead of the
76 user's default shell.
77 The program and arguments follows the user name.
78 .\" ==========
79 .It Fl h
80 The
81 .Fl h
82 option specifies the host from which the connection was received.
83 It is used by various daemons such as
84 .Xr telnetd 8 .
85 This option may only be used by the super-user.
86 .\" ==========
87 .It Fl l
88 Tells the program executed by
89 .Nm login
90 that this is not a login session (by convention, a login session is
91 signalled to the program with a hyphen as the first character of
92 .Em argv[0] ;
93 this option disables that), and prevents it from chdir(2)ing to the user's home directory.
94 The default is to add the hyphen (this is a login session).
95 .\" ==========
96 .It Fl p
97 By default,
98 .Nm login
99 discards any previous environment.
100 The
101 .Fl p
102 option disables this behavior.
103 .\" ==========
104 .It Fl q
105 This forces quiet logins, as if a
106 .Pa .hushlogin
107 is present.
108 .El
109 .Pp
110 If the file
111 .Pa /etc/nologin
112 exists,
113 .Nm login
114 dislays its contents to the user and exits.
115 This is used by
116 .Xr shutdown 8
117 to prevent users from logging in when the system is about to go down.
118 .Pp
119 Immediately after logging a user in,
120 .Nm login
121 displays the system copyright notice, the date and time the user last
122 logged in, the message of the day as well as other information.
123 If the file
124 .Dq Pa .hushlogin
125 exists in the user's home directory or
126 .Fl q
127 is specified, all of these messages are suppressed.
128 This is to simplify logins for non-human users, such as
129 .Xr uucp 1 .
130 .Nm Login
131 then records an entry in
132 .Xr utmpx 5
133 and the like, and executes the user's command interpreter (or the program
134 specified on the command line if
135 .Fl f
136 is specified).
137 .Pp
138 Login enters information into the environment (see
139 .Xr environ 7 )
140 specifying the user's home directory (HOME), command interpreter (SHELL),
141 search path (PATH), terminal type (TERM) and user name (both LOGNAME and
142 USER).
143 .Pp
144 The standard shells,
145 .Xr csh 1
146 and
147 .Xr sh 1 ,
148 do not fork before executing the
149 .Nm login
150 utility.
151 .Sh FILES
152 .Bl -tag -width /var/mail/userXXX -compact
153 .It Pa /etc/motd
154 message-of-the-day
155 .It Pa /etc/nologin
156 disallows logins
157 .It Pa /var/run/utmpx
158 current logins
159 .It Pa /var/mail/user
160 system mailboxes
161 .It Pa \&.hushlogin
162 makes login quieter
163 .El
164 .Sh SEE ALSO
165 .Xr chpass 1 ,
166 .Xr passwd 1 ,
167 .Xr rlogin 1 ,
168 .Xr getpass 3 ,
169 .Xr utmpx 5 ,
170 .Xr environ 7
171 .Sh HISTORY
172 A
173 .Nm login
174 appeared in
175 .At v6 .