BSD 4_4_Lite2 release
[unix-history] / usr / src / usr.bin / login / login.1
CommitLineData
ad787160
C
1.\" Copyright (c) 1980, 1990, 1993
2.\" The Regents of the University of California. All rights reserved.
55890414 3.\"
ad787160
C
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.
3c4adc3c 19.\"
ad787160
C
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.
55890414 31.\"
fd88f5c5 32.\" @(#)login.1 8.2 (Berkeley) 5/5/94
ad787160 33.\"
fd88f5c5 34.Dd May 5, 1994
3c003a08
CL
35.Dt LOGIN 1
36.Os BSD 4
37.Sh NAME
38.Nm login
6bd69362 39.Nd log into the computer
3c003a08
CL
40.Sh SYNOPSIS
41.Nm login
6bd69362 42.Op Fl fp
3c003a08 43.Op Fl h Ar hostname
545dd412 44.Op Ar user
3c003a08 45.Sh DESCRIPTION
55890414 46The
3c003a08 47.Nm login
6bd69362
KB
48utility logs users (and pseudo-users) into the computer system.
49.Pp
50If no user is specified, or if a user is specified and authentication
51of the user fails,
3c003a08 52.Nm login
6bd69362
KB
53prompts for a user name.
54Authentication of users is done via passwords.
3c003a08 55.Pp
6bd69362
KB
56The options are as follows:
57.Bl -tag -width Ds
545dd412
CL
58.It Fl f
59The
60.Fl f
6bd69362
KB
61option is used when a user name is specified to indicate that proper
62authentication has already been done and that no password need be
63requested.
64This option may only be used by the super-user or when an already
65logged in user is logging in as themselves.
66.It Fl h
545dd412
CL
67The
68.Fl h
6bd69362
KB
69option specifies the host from which the connection was received.
70It is used by various daemons such as
71.Xr telnetd 8 .
72This option may only be used by the super-user.
545dd412 73.It Fl p
6bd69362 74By default,
3c003a08 75.Nm login
6bd69362
KB
76discards any previous environment.
77The
78.Fl p
79option disables this behavior.
80.El
545dd412 81.Pp
6bd69362
KB
82If the file
83.Pa /etc/nologin
84exists,
545dd412 85.Nm login
6bd69362
KB
86dislays its contents to the user and exits.
87This is used by
88.Xr shutdown 8
89to prevent users from logging in when the system is about to go down.
3c003a08 90.Pp
545dd412
CL
91Immediately after logging a user in,
92.Nm login
6bd69362
KB
93displays the system copyright notice, the date and time the user last
94logged in, the message of the day as well as other information.
545dd412 95If the file
3c003a08 96.Dq Pa .hushlogin
6bd69362
KB
97exists in the user's home directory, all of these messages are suppressed.
98This is to simplify logins for non-human users, such as
3c003a08 99.Xr uucp 1 .
6bd69362 100.Nm Login
545dd412
CL
101then records an entry in the
102.Xr wtmp 5
103and
104.Xr utmp 5
6bd69362 105files and executes the user's command interpretor.
3c003a08 106.Pp
6bd69362 107Login enters information into the environment (see
5325ced3 108.Xr environ 7 )
6bd69362
KB
109specifying the user's home directory (HOME), command interpreter (SHELL),
110search path (PATH), terminal type (TERM) and user name (both LOGNAME and
111USER).
3c003a08 112.Pp
545dd412
CL
113The standard shells,
114.Xr csh 1
3c003a08 115and
6bd69362
KB
116.Xr sh 1 ,
117do not fork before executing the
118.Nm login
119utility.
3c003a08 120.Sh FILES
6bd69362 121.Bl -tag -width /var/mail/userXXX -compact
545dd412 122.It Pa /etc/motd
3c003a08 123message-of-the-day
545dd412
CL
124.It Pa /etc/nologin
125disallows logins
6bd69362
KB
126.It Pa /var/run/utmp
127current logins
4c8a011e
KB
128.It Pa /var/log/lastlog
129last login account records
6bd69362
KB
130.It Pa /var/log/wtmp
131login account records
132.It Pa /var/mail/user
133system mailboxes
545dd412 134.It Pa \&.hushlogin
3c003a08 135makes login quieter
545dd412 136.El
3c003a08 137.Sh SEE ALSO
6bd69362 138.Xr chpass 1 ,
3c003a08
CL
139.Xr passwd 1 ,
140.Xr rlogin 1 ,
141.Xr getpass 3 ,
3c003a08
CL
142.Xr utmp 5 ,
143.Xr environ 7 ,
3c003a08 144.Sh HISTORY
545dd412 145A
3c003a08 146.Nm login
545dd412
CL
147appeared in
148.At v6 .