xref: /original-bsd/usr.bin/login/login.1 (revision deff14a8)
1.\" Copyright (c) 1980, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)login.1	8.2 (Berkeley) 05/05/94
7.\"
8.Dd
9.Dt LOGIN 1
10.Os BSD 4
11.Sh NAME
12.Nm login
13.Nd log into the computer
14.Sh SYNOPSIS
15.Nm login
16.Op Fl fp
17.Op Fl h Ar hostname
18.Op Ar user
19.Sh DESCRIPTION
20The
21.Nm login
22utility logs users (and pseudo-users) into the computer system.
23.Pp
24If no user is specified, or if a user is specified and authentication
25of the user fails,
26.Nm login
27prompts for a user name.
28Authentication of users is done via passwords.
29.Pp
30The options are as follows:
31.Bl -tag -width Ds
32.It Fl f
33The
34.Fl f
35option is used when a user name is specified to indicate that proper
36authentication has already been done and that no password need be
37requested.
38This option may only be used by the super-user or when an already
39logged in user is logging in as themselves.
40.It Fl h
41The
42.Fl h
43option specifies the host from which the connection was received.
44It is used by various daemons such as
45.Xr telnetd  8 .
46This option may only be used by the super-user.
47.It Fl p
48By default,
49.Nm login
50discards any previous environment.
51The
52.Fl p
53option disables this behavior.
54.El
55.Pp
56If the file
57.Pa /etc/nologin
58exists,
59.Nm login
60dislays its contents to the user and exits.
61This is used by
62.Xr shutdown  8
63to prevent users from logging in when the system is about to go down.
64.Pp
65Immediately after logging a user in,
66.Nm login
67displays the system copyright notice, the date and time the user last
68logged in, the message of the day as well as other information.
69If the file
70.Dq Pa .hushlogin
71exists in the user's home directory, all of these messages are suppressed.
72This is to simplify logins for non-human users, such as
73.Xr uucp 1 .
74.Nm Login
75then records an entry in the
76.Xr wtmp 5
77and
78.Xr utmp 5
79files and executes the user's command interpretor.
80.Pp
81Login enters information into the environment (see
82.Xr environ 7 )
83specifying the user's home directory (HOME), command interpreter (SHELL),
84search path (PATH), terminal type (TERM) and user name (both LOGNAME and
85USER).
86.Pp
87The standard shells,
88.Xr csh 1
89and
90.Xr sh 1 ,
91do not fork before executing the
92.Nm login
93utility.
94.Sh FILES
95.Bl -tag -width /var/mail/userXXX -compact
96.It Pa /etc/motd
97message-of-the-day
98.It Pa /etc/nologin
99disallows logins
100.It Pa /var/run/utmp
101current logins
102.It Pa /var/log/lastlog
103last login account records
104.It Pa /var/log/wtmp
105login account records
106.It Pa /var/mail/user
107system mailboxes
108.It Pa \&.hushlogin
109makes login quieter
110.El
111.Sh SEE ALSO
112.Xr chpass 1 ,
113.Xr passwd 1 ,
114.Xr rlogin 1 ,
115.Xr getpass 3 ,
116.Xr utmp 5 ,
117.Xr environ 7 ,
118.Sh HISTORY
119A
120.Nm login
121appeared in
122.At v6 .
123