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. Neither the name of the University nor the names of its contributors 13.\" may be used to endorse or promote products derived from this software 14.\" without specific prior written permission. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.Dd September 29, 2022 29.Dt LOGIN 1 30.Os 31.Sh NAME 32.Nm login 33.Nd log into the computer 34.Sh SYNOPSIS 35.Nm 36.Op Fl fp 37.Op Fl h Ar hostname 38.Op Ar user 39.Sh DESCRIPTION 40The 41.Nm 42utility logs users (and pseudo-users) into the computer system. 43.Pp 44If no user is specified, or if a user is specified and authentication 45of the user fails, 46.Nm 47prompts for a user name. 48Authentication of users is configurable via 49.Xr pam 8 . 50Password authentication is the default. 51.Pp 52The following options are available: 53.Bl -tag -width indent 54.It Fl f 55When a user name is specified, this option indicates that proper 56authentication has already been done and that no password need be 57requested. 58This option may only be used by the super-user or when an already 59logged in user is logging in as themselves. 60.It Fl h 61Specify the host from which the connection was received. 62It is used by various daemons such as 63.Nm telnetd . 64This option may only be used by the super-user. 65.It Fl p 66By default, 67.Nm 68discards any previous environment. 69The 70.Fl p 71option disables this behavior. 72.El 73.Pp 74Login access can be controlled via 75.Xr login.access 5 76or the login class in 77.Xr login.conf 5 , 78which provides 79allow and deny records based on time, tty and remote host name. 80.Pp 81If the file 82.Pa /etc/fbtab 83exists, 84.Nm 85changes the protection and ownership of certain devices specified in this 86file. 87.Pp 88Immediately after logging a user in, 89.Nm 90displays the system copyright notice, the date and time the user last 91logged in, the message of the day as well as other information. 92If the file 93.Pa .hushlogin 94exists in the user's home directory, all of these messages are suppressed. 95This is to simplify logins for non-human users, such as 96.Xr uucp 1 . 97.Pp 98The 99.Nm 100utility enters information into the environment (see 101.Xr environ 7 ) 102specifying the user's home directory (HOME), command interpreter (SHELL), 103search path (PATH), terminal type (TERM) and user name (both LOGNAME and 104USER). 105Other environment variables may be set due to entries in the login 106class capabilities database, for the login class assigned in the 107user's system passwd record. 108The login class also controls the maximum and current process resource 109limits granted to a login, process priorities and many other aspects of 110a user's login environment. 111.Pp 112Some shells may provide a builtin 113.Nm 114command which is similar or identical to this utility. 115Consult the 116.Xr builtin 1 117manual page. 118.Pp 119The 120.Nm 121utility will submit an audit record when login succeeds or fails. 122Failure to determine the current auditing state will 123result in an error exit from 124.Nm . 125.Sh FILES 126.Bl -tag -width ".Pa /etc/security/audit_control" -compact 127.It Pa /etc/fbtab 128changes device protections 129.It Pa /etc/login.conf 130login class capabilities database 131.It Pa /var/run/motd 132message-of-the-day 133.It Pa /var/mail/user 134system mailboxes 135.It Pa \&.hushlogin 136makes login quieter 137.It Pa /etc/pam.d/login 138.Xr pam 8 139configuration file 140.It Pa /etc/security/audit_user 141user flags for auditing 142.It Pa /etc/security/audit_control 143global flags for auditing 144.El 145.Sh SEE ALSO 146.Xr builtin 1 , 147.Xr chpass 1 , 148.Xr csh 1 , 149.Xr newgrp 1 , 150.Xr passwd 1 , 151.Xr rlogin 1 , 152.Xr getpass 3 , 153.Xr fbtab 5 , 154.Xr login.access 5 , 155.Xr login.conf 5 , 156.Xr environ 7 157.Sh HISTORY 158A 159.Nm 160utility appeared in 161.At v6 . 162