Annotation of src/usr.bin/login/login.1, Revision 1.26
1.26 ! jmc 1: .\" $OpenBSD: login.1,v 1.25 2007/03/26 14:29:37 jmc Exp $
1.1 deraadt 2: .\"
3: .\" Copyright (c) 1980, 1990, 1993
4: .\" The Regents of the University of California. All rights reserved.
5: .\"
6: .\" Redistribution and use in source and binary forms, with or without
7: .\" modification, are permitted provided that the following conditions
8: .\" are met:
9: .\" 1. Redistributions of source code must retain the above copyright
10: .\" notice, this list of conditions and the following disclaimer.
11: .\" 2. Redistributions in binary form must reproduce the above copyright
12: .\" notice, this list of conditions and the following disclaimer in the
13: .\" documentation and/or other materials provided with the distribution.
1.21 millert 14: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 15: .\" may be used to endorse or promote products derived from this software
16: .\" without specific prior written permission.
17: .\"
18: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28: .\" SUCH DAMAGE.
29: .\"
30: .\" @(#)login.1 8.2 (Berkeley) 5/5/94
31: .\"
32: .Dd May 5, 1994
33: .Dt LOGIN 1
1.9 aaron 34: .Os
1.1 deraadt 35: .Sh NAME
36: .Nm login
37: .Nd log into the computer
38: .Sh SYNOPSIS
39: .Nm login
40: .Op Fl fp
41: .Op Fl h Ar hostname
1.26 ! jmc 42: .Op Fl L Ar local-addr
! 43: .Op Fl R Ar remote-addr
1.14 millert 44: .Op Fl u Ar username
1.1 deraadt 45: .Op Ar user
46: .Sh DESCRIPTION
47: The
1.9 aaron 48: .Nm
1.1 deraadt 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,
1.9 aaron 53: .Nm
1.1 deraadt 54: prompts for a user name.
1.15 millert 55: Authentication of users is normally done via passwords, though
56: external authentication mechanisms may be used (see
1.16 mpech 57: .Xr login.conf 5 ) .
1.15 millert 58: To specify the alternate authentication mechanism
59: .Va style ,
60: the string
61: .Li : Ns Va style
62: is appended to the user name (i.e.,
1.22 jmc 63: .Ar user Ns Li : Ns Va style ) .
1.1 deraadt 64: .Pp
65: The options are as follows:
66: .Bl -tag -width Ds
67: .It Fl f
68: The
69: .Fl f
70: option is used when a user name is specified to indicate that proper
71: authentication has already been done and that no password need be
72: requested.
1.12 aaron 73: This option may only be used by the superuser or when an already
1.1 deraadt 74: logged in user is logging in as themselves.
1.11 deraadt 75: .It Fl h Ar hostname
1.14 millert 76: Specifies the host from which the connection was received.
77: This option may only be used by the superuser.
1.26 ! jmc 78: .It Fl L Ar local-addr
1.15 millert 79: The
80: .Fl L
1.26 ! jmc 81: option specifies the local address of a socket.
1.15 millert 82: This information is passed on to any classify script (see
83: .Xr login.conf 5 ) .
1.1 deraadt 84: .It Fl p
85: By default,
1.9 aaron 86: .Nm
1.1 deraadt 87: discards any previous environment.
88: The
89: .Fl p
90: option disables this behavior.
1.26 ! jmc 91: .It Fl R Ar remote-addr
1.15 millert 92: The
93: .Fl R
1.26 ! jmc 94: option specifies the remote address of a socket.
1.15 millert 95: This information is passed on to any classify script (see
96: .Xr login.conf 5 ) .
97: .It Fl u Ar username
98: Specifies the remote user that initiated the connection.
99: This option may only be used by the superuser.
1.1 deraadt 100: .El
101: .Pp
102: If the file
103: .Pa /etc/nologin
1.15 millert 104: exists (and the
105: .Dq ignorenologin
106: boolean is not set in the user's login class),
1.9 aaron 107: .Nm
1.1 deraadt 108: displays its contents to the user and exits.
109: This is used by
1.12 aaron 110: .Xr shutdown 8
1.1 deraadt 111: to prevent users from logging in when the system is about to go down.
112: .Pp
1.3 deraadt 113: If the file
114: .Pa /etc/fbtab
115: exists,
1.9 aaron 116: .Nm
1.3 deraadt 117: changes the protection and ownership of certain devices specified in this
118: file.
119: .Pp
1.10 aaron 120: If the file
1.5 millert 121: .Pa /var/log/failedlogin
1.10 aaron 122: exists,
1.9 aaron 123: .Nm
1.5 millert 124: will record failed login attempts in this file.
125: .Pp
1.1 deraadt 126: Immediately after logging a user in,
1.9 aaron 127: .Nm
1.1 deraadt 128: displays the system copyright notice, the date and time the user last
1.8 pjanzen 129: logged in, the date and time of the last unsuccessful login (if the file
1.5 millert 130: .Pa /var/log/failedlogin
131: exists), the message of the day as well as other information.
1.1 deraadt 132: If the file
133: .Dq Pa .hushlogin
134: exists in the user's home directory, all of these messages are suppressed.
135: This is to simplify logins for non-human users, such as
1.20 jmc 136: .Xr uucp .
1.9 aaron 137: .Nm
1.1 deraadt 138: then records an entry in the
139: .Xr wtmp 5
140: and
141: .Xr utmp 5
142: files and executes the user's command interpreter.
143: .Pp
1.9 aaron 144: .Nm
1.7 aaron 145: enters information into the environment (see
1.1 deraadt 146: .Xr environ 7 )
1.7 aaron 147: specifying the user's home directory
148: .Pq Ev HOME ,
149: command interpreter
150: .Pq Ev SHELL ,
151: search path
152: .Pq Ev PATH ,
153: terminal type
154: .Pq Ev TERM ,
155: and user name
156: .Po both Ev LOGNAME and Ev USER
157: .Pc .
1.1 deraadt 158: .Pp
159: The standard shells,
160: .Xr csh 1
161: and
162: .Xr sh 1 ,
163: do not fork before executing the
1.9 aaron 164: .Nm
1.1 deraadt 165: utility.
1.19 millert 166: .Pp
167: Note that if
168: .Nm
169: is invoked by a non-root user, it will execute
170: .Xr su 1
171: in
172: .Nm
173: emulation mode instead.
1.14 millert 174: .Sh ENVIRONMENT
175: .Nm
176: sets the following environment variables:
177: .Bl -tag -width REMOTEHOST
178: .It Ev HOME
179: The user's home directory, as specified by the password database.
180: .It Ev SHELL
181: The user's shell, as specified by the password database.
182: .It Ev TERM
183: The user's terminal type, if it can be determined.
184: .It Ev LOGNAME
185: The user's login name.
186: .It Ev USER
187: Same as
188: .Ev LOGNAME .
189: .It Ev REMOTEHOST
190: The name of the host from which the user logged in, if the
191: .Fl h
192: flag was specified.
193: .It Ev REMOTEUSER
194: The name of the remote user who initiated the connection, if the
195: .Fl u
196: flag was specified.
197: .El
1.23 millert 198: .Pp
199: Other environment variables may be specified in
200: .Pa /etc/login.conf
201: via the
202: .Dq setenv
203: capability.
1.1 deraadt 204: .Sh FILES
1.7 aaron 205: .Bl -tag -width /var/log/failedlogin -compact
1.3 deraadt 206: .It Pa /etc/fbtab
207: changes device protections
1.15 millert 208: .It Pa /etc/login.conf
209: login configuration
1.1 deraadt 210: .It Pa /etc/motd
211: message-of-the-day
212: .It Pa /etc/nologin
213: disallows logins
1.15 millert 214: .It Pa /var/log/failedlogin
215: failed login account records
1.1 deraadt 216: .It Pa /var/log/lastlog
217: last login account records
218: .It Pa /var/log/wtmp
219: login account records
220: .It Pa /var/mail/user
221: system mailboxes
1.25 jmc 222: .It Pa /var/run/utmp
223: current logins
1.1 deraadt 224: .It Pa \&.hushlogin
225: makes login quieter
226: .El
227: .Sh SEE ALSO
228: .Xr chpass 1 ,
229: .Xr passwd 1 ,
1.19 millert 230: .Xr su 1 ,
1.18 millert 231: .Xr telnet 1 ,
1.1 deraadt 232: .Xr getpass 3 ,
1.15 millert 233: .Xr setusercontext 3 ,
1.7 aaron 234: .Xr fbtab 5 ,
1.15 millert 235: .Xr login.conf 5 ,
1.1 deraadt 236: .Xr utmp 5 ,
1.7 aaron 237: .Xr environ 7
1.1 deraadt 238: .Sh HISTORY
239: A
1.9 aaron 240: .Nm
1.7 aaron 241: utility appeared in
1.17 mickey 242: .At v3 .