xref: /freebsd/usr.bin/login/login.1 (revision 39beb93c)
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$
34.\"
35.Dd September 13, 2006
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
47The
48.Nm
49utility logs users (and pseudo-users) into the computer system.
50.Pp
51If no user is specified, or if a user is specified and authentication
52of the user fails,
53.Nm
54prompts for a user name.
55Authentication of users is configurable via
56.Xr pam 8 .
57Password authentication is the default.
58.Pp
59The following options are available:
60.Bl -tag -width indent
61.It Fl f
62When a user name is specified, this option indicates that proper
63authentication has already been done and that no password need be
64requested.
65This option may only be used by the super-user or when an already
66logged in user is logging in as themselves.
67.It Fl h
68Specify the host from which the connection was received.
69It is used by various daemons such as
70.Xr telnetd 8 .
71This option may only be used by the super-user.
72.It Fl p
73By default,
74.Nm
75discards any previous environment.
76The
77.Fl p
78option disables this behavior.
79.El
80.Pp
81Login access can be controlled via
82.Xr login.access 5
83or the login class in
84.Xr login.conf 5 ,
85which provides
86allow and deny records based on time, tty and remote host name.
87.Pp
88If the file
89.Pa /etc/fbtab
90exists,
91.Nm
92changes the protection and ownership of certain devices specified in this
93file.
94.Pp
95Immediately after logging a user in,
96.Nm
97displays the system copyright notice, the date and time the user last
98logged in, the message of the day as well as other information.
99If the file
100.Pa .hushlogin
101exists in the user's home directory, all of these messages are suppressed.
102This is to simplify logins for non-human users, such as
103.Xr uucp 1 .
104.Pp
105The
106.Nm
107utility enters information into the environment (see
108.Xr environ 7 )
109specifying the user's home directory (HOME), command interpreter (SHELL),
110search path (PATH), terminal type (TERM) and user name (both LOGNAME and
111USER).
112Other environment variables may be set due to entries in the login
113class capabilities database, for the login class assigned in the
114user's system passwd record.
115The login class also controls the maximum and current process resource
116limits granted to a login, process priorities and many other aspects of
117a user's login environment.
118.Pp
119Some shells may provide a builtin
120.Nm
121command which is similar or identical to this utility.
122Consult the
123.Xr builtin 1
124manual page.
125.Pp
126The
127.Nm
128utility will submit an audit record when login succeeds or fails.
129Failure to determine the current auditing state will
130result in an error exit from
131.Nm .
132.Sh FILES
133.Bl -tag -width ".Pa /etc/security/audit_control" -compact
134.It Pa /etc/fbtab
135changes device protections
136.It Pa /etc/login.conf
137login class capabilities database
138.It Pa /etc/motd
139message-of-the-day
140.It Pa /var/mail/user
141system mailboxes
142.It Pa \&.hushlogin
143makes login quieter
144.It Pa /etc/auth.conf
145configure authentication services
146.It Pa /etc/pam.d/login
147.Xr pam 8
148configuration file
149.It Pa /etc/security/audit_user
150user flags for auditing
151.It Pa /etc/security/audit_control
152global flags for auditing
153.El
154.Sh SEE ALSO
155.Xr builtin 1 ,
156.Xr chpass 1 ,
157.Xr csh 1 ,
158.Xr newgrp 1 ,
159.Xr passwd 1 ,
160.Xr rlogin 1 ,
161.Xr getpass 3 ,
162.Xr fbtab 5 ,
163.Xr login.access 5 ,
164.Xr login.conf 5 ,
165.Xr environ 7
166.Sh HISTORY
167A
168.Nm
169utility appeared in
170.At v6 .
171