Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.bin / login / 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 .\" $FreeBSD: src/usr.bin/login/login.1,v 1.17.2.2 2002/06/21 15:27:56 charnier Exp $
34 .\"
35 .Dd May 5, 1994
36 .Dt LOGIN 1
37 .Os
38 .Sh NAME
39 .Nm login
40 .Nd log into the computer
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl fp
44 .Op Fl h Ar hostname
45 .Op Ar user
46 .Sh DESCRIPTION
47 The
48 .Nm
49 utility logs users (and pseudo-users) into the computer system.
50 .Pp
51 If no user is specified, or if a user is specified and authentication
52 of the user fails,
53 .Nm
54 prompts for a user name.
55 Authentication of users is done via passwords.
56 .Pp
57 The options are as follows:
58 .Bl -tag -width Ds
59 .It Fl f
60 The
61 .Fl f
62 option is used when a user name is specified to indicate that proper
63 authentication has already been done and that no password need be
64 requested.
65 This option may only be used by the super-user or when an already
66 logged in user is logging in as themselves.
67 .It Fl h
68 The
69 .Fl h
70 option specifies the host from which the connection was received.
71 It is used by various daemons such as
72 .Xr telnetd  8 .
73 This option may only be used by the super-user.
74 .It Fl p
75 By default,
76 .Nm
77 discards any previous environment.
78 The
79 .Fl p
80 option disables this behavior.
81 .El
82 .Pp
83 If the file
84 .Pa /var/run/nologin
85 exists,
86 .Nm
87 displays its contents to the user and exits.
88 This is used by
89 .Xr shutdown  8
90 to prevent users from logging in when the system is about to go down.
91 .Pp
92 If the file
93 .Pa /etc/login.access
94 exists,
95 .Nm
96 checks to see if the user and host pair are specifically allowed or denied
97 access.
98 Login access may also be controlled via the login class, which provides
99 allow and deny records based on time, tty and remote host name.
100 .Pp
101 If the file
102 .Pa /etc/fbtab
103 exists,
104 .Nm
105 changes the protection and ownership of certain devices specified in this
106 file.
107 .Pp
108 If the file
109 .Pa /etc/skeykeys
110 exists,
111 .Nm
112 will offer S/key password validation if the user has an entry in the file.
113 .Pa /etc/skey.access
114 controls from which hosts and/or networks the use of S/key passwords are
115 obligated.
116 .Pp
117 Immediately after logging a user in,
118 .Nm
119 displays the system copyright notice, the date and time the user last
120 logged in, the message of the day as well as other information.
121 If the file
122 .Dq Pa .hushlogin
123 exists in the user's home directory, all of these messages are suppressed.
124 This is to simplify logins for non-human users, such as
125 .Xr uucp 1 .
126 The
127 .Nm
128 utility then records an entry in the
129 .Xr wtmp 5
130 and
131 .Xr utmp 5
132 files and executes the user's command interpreter.
133 .Pp
134 The
135 .Nm
136 utility enters information into the environment (see
137 .Xr environ 7 )
138 specifying the user's home directory (HOME), command interpreter (SHELL),
139 search path (PATH), terminal type (TERM) and user name (both LOGNAME and
140 USER).
141 Other environment variables may be set due to entries in the login
142 class capabilities database, for the login class assigned in the
143 user's system passwd record.
144 The login class also controls the maximum and current process resource
145 limits granted to a login, process priorities and many other aspects of
146 a user's login environment.
147 .Pp
148 Some shells may provide a builtin
149 .Nm
150 command which is similar or identical to this utility.
151 Consult the
152 .Xr builtin 1
153 manual page.
154 .Sh FILES
155 .Bl -tag -width /var/mail/userXXX -compact
156 .It Pa /etc/fbtab
157 changes device protections
158 .It Pa /etc/login.access
159 login access control table
160 .It Pa /etc/login.conf
161 login class capabilities database
162 .It Pa /etc/motd
163 message-of-the-day
164 .It Pa /var/run/nologin
165 disallows logins
166 .It Pa /etc/skey.access
167 skey password control table
168 .It Pa /etc/skeykeys
169 skey password database
170 .It Pa /var/run/utmp
171 current logins
172 .It Pa /var/log/lastlog
173 last login account records
174 .It Pa /var/log/wtmp
175 login account records
176 .It Pa /var/mail/user
177 system mailboxes
178 .It Pa \&.hushlogin
179 makes login quieter
180 .It Pa /etc/auth.conf
181 configure authentication services
182 .It Pa /etc/pam.conf
183 if
184 .Nm
185 is configured with PAM support, it uses
186 .Pa /etc/pam.conf
187 entries with service name
188 .Dq login
189 .El
190 .Sh SEE ALSO
191 .Xr builtin 1 ,
192 .Xr chpass 1 ,
193 .Xr csh 1 ,
194 .Xr passwd 1 ,
195 .Xr rlogin 1 ,
196 .Xr skey 1 ,
197 .Xr getpass 3 ,
198 .Xr fbtab 5 ,
199 .Xr login.access 5 ,
200 .Xr login.conf 5 ,
201 .Xr nologin 5 ,
202 .Xr skey.access 5 ,
203 .Xr utmp 5 ,
204 .Xr environ 7 ,
205 .Xr nologin 8 ,
206 .Xr pam 8
207 .Sh HISTORY
208 A
209 .Nm
210 utility appeared in
211 .At v6 .