xref: /freebsd/usr.bin/login/login.1 (revision bdcbfde31e8e9b343f113a1956384bdf30d1ed62)
19b50d902SRodney W. Grimes.\" Copyright (c) 1980, 1990, 1993
29b50d902SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
39b50d902SRodney W. Grimes.\"
49b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
59b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions
69b50d902SRodney W. Grimes.\" are met:
79b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
89b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
99b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
109b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
119b50d902SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
139b50d902SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
149b50d902SRodney W. Grimes.\"    without specific prior written permission.
159b50d902SRodney W. Grimes.\"
169b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
179b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
189b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
199b50d902SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
209b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
219b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
229b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
239b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
249b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
259b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
269b50d902SRodney W. Grimes.\" SUCH DAMAGE.
279b50d902SRodney W. Grimes.\"
28*b4cfdbfeSBrooks Davis.Dd September 29, 2022
299b50d902SRodney W. Grimes.Dt LOGIN 1
3062500372SRuslan Ermilov.Os
319b50d902SRodney W. Grimes.Sh NAME
329b50d902SRodney W. Grimes.Nm login
339b50d902SRodney W. Grimes.Nd log into the computer
349b50d902SRodney W. Grimes.Sh SYNOPSIS
359c9cb2bfSPhilippe Charnier.Nm
369b50d902SRodney W. Grimes.Op Fl fp
379b50d902SRodney W. Grimes.Op Fl h Ar hostname
389b50d902SRodney W. Grimes.Op Ar user
399b50d902SRodney W. Grimes.Sh DESCRIPTION
409b50d902SRodney W. GrimesThe
419c9cb2bfSPhilippe Charnier.Nm
429b50d902SRodney W. Grimesutility logs users (and pseudo-users) into the computer system.
439b50d902SRodney W. Grimes.Pp
449b50d902SRodney W. GrimesIf no user is specified, or if a user is specified and authentication
459b50d902SRodney W. Grimesof the user fails,
469c9cb2bfSPhilippe Charnier.Nm
479b50d902SRodney W. Grimesprompts for a user name.
48d47b06fcSDaniel HarrisAuthentication of users is configurable via
49d47b06fcSDaniel Harris.Xr pam 8 .
50d47b06fcSDaniel HarrisPassword authentication is the default.
519b50d902SRodney W. Grimes.Pp
52e72bbdf4SPhilippe CharnierThe following options are available:
53e72bbdf4SPhilippe Charnier.Bl -tag -width indent
549b50d902SRodney W. Grimes.It Fl f
55e72bbdf4SPhilippe CharnierWhen a user name is specified, this option indicates that proper
569b50d902SRodney W. Grimesauthentication has already been done and that no password need be
579b50d902SRodney W. Grimesrequested.
589b50d902SRodney W. GrimesThis option may only be used by the super-user or when an already
599b50d902SRodney W. Grimeslogged in user is logging in as themselves.
609b50d902SRodney W. Grimes.It Fl h
61e72bbdf4SPhilippe CharnierSpecify the host from which the connection was received.
629b50d902SRodney W. GrimesIt is used by various daemons such as
63*b4cfdbfeSBrooks Davis.Nm telnetd .
649b50d902SRodney W. GrimesThis option may only be used by the super-user.
659b50d902SRodney W. Grimes.It Fl p
669b50d902SRodney W. GrimesBy default,
679c9cb2bfSPhilippe Charnier.Nm
689b50d902SRodney W. Grimesdiscards any previous environment.
699b50d902SRodney W. GrimesThe
709b50d902SRodney W. Grimes.Fl p
719b50d902SRodney W. Grimesoption disables this behavior.
729b50d902SRodney W. Grimes.El
739b50d902SRodney W. Grimes.Pp
74ebf3356aSYaroslav TykhiyLogin access can be controlled via
75ebf3356aSYaroslav Tykhiy.Xr login.access 5
76ebf3356aSYaroslav Tykhiyor the login class in
77ebf3356aSYaroslav Tykhiy.Xr login.conf 5 ,
78ebf3356aSYaroslav Tykhiywhich provides
795217f56eSDavid Nugentallow and deny records based on time, tty and remote host name.
80e830e7f5SMike Pritchard.Pp
81e830e7f5SMike PritchardIf the file
82f88fe867SGuido van Rooij.Pa /etc/fbtab
83f88fe867SGuido van Rooijexists,
849c9cb2bfSPhilippe Charnier.Nm
85f88fe867SGuido van Rooijchanges the protection and ownership of certain devices specified in this
86f88fe867SGuido van Rooijfile.
87f88fe867SGuido van Rooij.Pp
889b50d902SRodney W. GrimesImmediately after logging a user in,
899c9cb2bfSPhilippe Charnier.Nm
909b50d902SRodney W. Grimesdisplays the system copyright notice, the date and time the user last
919b50d902SRodney W. Grimeslogged in, the message of the day as well as other information.
929b50d902SRodney W. GrimesIf the file
93e72bbdf4SPhilippe Charnier.Pa .hushlogin
949b50d902SRodney W. Grimesexists in the user's home directory, all of these messages are suppressed.
959b50d902SRodney W. GrimesThis is to simplify logins for non-human users, such as
969b50d902SRodney W. Grimes.Xr uucp 1 .
979b50d902SRodney W. Grimes.Pp
98e8937ba0SPhilippe CharnierThe
99e8937ba0SPhilippe Charnier.Nm
100e8937ba0SPhilippe Charnierutility enters information into the environment (see
1019b50d902SRodney W. Grimes.Xr environ 7 )
1029b50d902SRodney W. Grimesspecifying the user's home directory (HOME), command interpreter (SHELL),
1039b50d902SRodney W. Grimessearch path (PATH), terminal type (TERM) and user name (both LOGNAME and
1049b50d902SRodney W. GrimesUSER).
1055217f56eSDavid NugentOther environment variables may be set due to entries in the login
1065217f56eSDavid Nugentclass capabilities database, for the login class assigned in the
1075217f56eSDavid Nugentuser's system passwd record.
1085217f56eSDavid NugentThe login class also controls the maximum and current process resource
1095217f56eSDavid Nugentlimits granted to a login, process priorities and many other aspects of
1105217f56eSDavid Nugenta user's login environment.
1119b50d902SRodney W. Grimes.Pp
112c644db6aSSheldon HearnSome shells may provide a builtin
1139c9cb2bfSPhilippe Charnier.Nm
114e6d3cf26SSheldon Hearncommand which is similar or identical to this utility.
115e6d3cf26SSheldon HearnConsult the
116c644db6aSSheldon Hearn.Xr builtin 1
117c644db6aSSheldon Hearnmanual page.
118a1c73d21SWayne Salamon.Pp
119a1c73d21SWayne SalamonThe
120a1c73d21SWayne Salamon.Nm
121a1c73d21SWayne Salamonutility will submit an audit record when login succeeds or fails.
122a1c73d21SWayne SalamonFailure to determine the current auditing state will
123a1c73d21SWayne Salamonresult in an error exit from
124a1c73d21SWayne Salamon.Nm .
1259b50d902SRodney W. Grimes.Sh FILES
126cb29445aSRuslan Ermilov.Bl -tag -width ".Pa /etc/security/audit_control" -compact
127f88fe867SGuido van Rooij.It Pa /etc/fbtab
128f88fe867SGuido van Rooijchanges device protections
1295217f56eSDavid Nugent.It Pa /etc/login.conf
1305217f56eSDavid Nugentlogin class capabilities database
1312826da43SConrad Meyer.It Pa /var/run/motd
1329b50d902SRodney W. Grimesmessage-of-the-day
1339b50d902SRodney W. Grimes.It Pa /var/mail/user
1349b50d902SRodney W. Grimessystem mailboxes
1359b50d902SRodney W. Grimes.It Pa \&.hushlogin
1369b50d902SRodney W. Grimesmakes login quieter
137a0d974b1SChristian Brueffer.It Pa /etc/pam.d/login
138a0d974b1SChristian Brueffer.Xr pam 8
139a0d974b1SChristian Bruefferconfiguration file
140a1c73d21SWayne Salamon.It Pa /etc/security/audit_user
141a1c73d21SWayne Salamonuser flags for auditing
142a1c73d21SWayne Salamon.It Pa /etc/security/audit_control
143a1c73d21SWayne Salamonglobal flags for auditing
1449b50d902SRodney W. Grimes.El
1459b50d902SRodney W. Grimes.Sh SEE ALSO
146c644db6aSSheldon Hearn.Xr builtin 1 ,
1479b50d902SRodney W. Grimes.Xr chpass 1 ,
148c644db6aSSheldon Hearn.Xr csh 1 ,
149db3dfd0eSPhilip Paeps.Xr newgrp 1 ,
1509b50d902SRodney W. Grimes.Xr passwd 1 ,
1519b50d902SRodney W. Grimes.Xr rlogin 1 ,
1529b50d902SRodney W. Grimes.Xr getpass 3 ,
153f88fe867SGuido van Rooij.Xr fbtab 5 ,
154e830e7f5SMike Pritchard.Xr login.access 5 ,
1555217f56eSDavid Nugent.Xr login.conf 5 ,
1563e1f3315SJoel Dahl.Xr environ 7
1579b50d902SRodney W. Grimes.Sh HISTORY
1589b50d902SRodney W. GrimesA
1599c9cb2bfSPhilippe Charnier.Nm
1609c9cb2bfSPhilippe Charnierutility appeared in
1619b50d902SRodney W. Grimes.At v6 .
162