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.1 (Berkeley) 6/9/93 33.\" $Id$ 34.\" 35.Dd June 9, 1993 36.Dt LOGIN 1 37.Os BSD 4 38.Sh NAME 39.Nm login 40.Nd log into the computer 41.Sh SYNOPSIS 42.Nm login 43.Op Fl fp 44.Op Fl h Ar hostname 45.Op Ar user 46.Sh DESCRIPTION 47The 48.Nm login 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 login 54prompts for a user name. 55Authentication of users is done via passwords. 56.Pp 57The options are as follows: 58.Bl -tag -width Ds 59.It Fl f 60The 61.Fl f 62option is used when a user name is specified to indicate 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 68The 69.Fl h 70option specifies the host from which the connection was received. 71It is used by various daemons such as 72.Xr telnetd 8 . 73This option may only be used by the super-user. 74.It Fl p 75By default, 76.Nm login 77discards any previous environment. 78The 79.Fl p 80option disables this behavior. 81.El 82.Pp 83If the file 84.Pa /etc/nologin 85exists, 86.Nm login 87displays its contents to the user and exits. 88This is used by 89.Xr shutdown 8 90to prevent users from logging in when the system is about to go down. 91.Pp 92If the file 93.Pa /etc/login.access 94exists, 95.Nm login 96checks to see if the user and host pair are specifically allowed or denied 97access. 98Login access may also be controlled via the login class, which provides 99allow and deny records based on time, tty and remote host name. 100.Pp 101If the file 102.Pa /etc/fbtab 103exists, 104.Nm login 105changes the protection and ownership of certain devices specified in this 106file. 107.Pp 108Immediately after logging a user in, 109.Nm login 110displays the system copyright notice, the date and time the user last 111logged in, the message of the day as well as other information. 112If the file 113.Dq Pa .hushlogin 114exists in the user's home directory, all of these messages are suppressed. 115This is to simplify logins for non-human users, such as 116.Xr uucp 1 . 117.Nm Login 118then records an entry in the 119.Xr wtmp 5 120and 121.Xr utmp 5 122files and executes the user's command interpretor. 123.Pp 124Login enters information into the environment (see 125.Xr environ 7 ) 126specifying the user's home directory (HOME), command interpreter (SHELL), 127search path (PATH), terminal type (TERM) and user name (both LOGNAME and 128USER). 129Other environment variables may be set due to entries in the login 130class capabilities database, for the login class assigned in the 131user's system passwd record. 132The login class also controls the maximum and current process resource 133limits granted to a login, process priorities and many other aspects of 134a user's login environment. 135.Pp 136The standard shells, 137.Xr csh 1 138and 139.Xr sh 1 , 140do not fork before executing the 141.Nm login 142utility. 143.Sh FILES 144.Bl -tag -width /var/mail/userXXX -compact 145.It Pa /etc/fbtab 146changes device protections 147.It Pa /etc/login.conf 148login class capabilities database 149.It Pa /etc/motd 150message-of-the-day 151.It Pa /etc/nologin 152disallows logins 153.It Pa /etc/login.access 154login access control table 155.It Pa /var/run/utmp 156current logins 157.It Pa /var/log/wtmp 158login account records 159.It Pa /var/mail/user 160system mailboxes 161.It Pa \&.hushlogin 162makes 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 fbtab 5 , 170.Xr login.access 5 , 171.Xr login.conf 5 , 172.Xr utmp 5 , 173.Xr environ 7 , 174.Xr nologin 8 175.Sh HISTORY 176A 177.Nm login 178appeared in 179.At v6 . 180