date and time created 90/06/25 13:56:22 by bostic
[unix-history] / usr / src / usr.bin / login / login.1
CommitLineData
3c003a08 1.\" Copyright (c) 1980, 1990 Regents of the University of California.
55890414
KM
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
3c003a08 5.\" @(#)login.1 6.7 (Berkeley) %G%
55890414 6.\"
3c003a08
CL
7.Dd
8.Dt LOGIN 1
9.Os BSD 4
10.Sh NAME
11.Nm login
12.Nd sign on
13.Sh SYNOPSIS
14.Nm login
15.Op Fl p
16.Op Ar username
17.Nm login
18.Op Fl p
19.Op Fl h Ar hostname
20.Op Fl f
21.Op Ar username
22.Sh DESCRIPTION
55890414 23The
3c003a08 24.Nm login
55890414
KM
25command
26is used when a user initially
7ed14798
MK
27signs on.
28It may also be used at any time to change
55890414 29from one user to another.
7ed14798 30This case is the one summarized first above and described here.
3c003a08
CL
31See
32.Em How to Get Started
33for how to connect initially.
7ed14798 34The invocation of
3c003a08 35.Nm login
7ed14798
MK
36for initial sign-on
37is made by a system program or server using the latter form of the command
38and is described below.
3c003a08 39.Pp
55890414 40If
3c003a08 41.Nm login
55890414
KM
42is invoked without an argument,
43it asks for a user name, and, if
44appropriate, a password.
45Echoing is turned off (if possible) during the typing of the password,
46so it will not appear on the written record of the
47session.
3c003a08 48.Pp
55890414
KM
49After a successful login,
50accounting files are updated and
51the user is informed of the
678ce1ab
MK
52existence of mail.
53The message of the day is printed,
54as is the time of his last login.
3c003a08
CL
55Both are suppressed if he has a
56.Dq Pa .hushlogin
678ce1ab 57file in his home directory; this
55890414 58is mostly used to make life easier for non-human users, such as
3c003a08
CL
59.Xr uucp 1 .
60.Pp
61.Nm Login
55890414
KM
62initializes the user and group IDs and the working directory,
63then executes a command interpreter (usually
3c003a08 64.Xr csh 1 )
55890414 65according to specifications found in a password file.
678ce1ab
MK
66Argument 0 of the command interpreter is
67the name of the command interpreter with
3c003a08
CL
68a leading dash
69.Sq Fl .
70.Pp
06ae098a 71Login also modifies the
55890414 72environment
3c003a08 73.Xr environ 7
55890414
KM
74with information specifying home directory, command interpreter, terminal
75type (if available) and user name.
3c003a08
CL
76.Pp
77Options:
78.Pp
79.Tw Fl
80.Tp Fl p
81Causes the remainder of the environment to be preserved,
678ce1ab 82otherwise any previous environment is discarded.
3c003a08 83.Tp Fl h
7ed14798 84option is used by
3c003a08
CL
85.Ar telnetd 8
86(at initial login)
7ed14798
MK
87and other servers to list the host from which
88the connection was received.
3c003a08
CL
89.Tp Fl f
90Used with a username on the command line, at initial login,
7ed14798
MK
91to indicate that proper authentication has already been done
92and that no password need be requested.
93This option may be used by the superuser
94or by the user specified on the command line.
3c003a08
CL
95.Tp
96.Pp
97If the file
98.Pa /etc/nologin
99exists,
100.Nm login
101prints its contents on the user's terminal and exits. This is
102used by
103.Xr shutdown 8
104to stop users logging in when the system is about to go down.
105.Pp
106Login is recognized by
107.Xr sh 1
108and
109.Xr csh 1
110and executed directly (without forking).
111.Sh FILES
112.Dw /var/log/wtmp
113.Di L
114.Dp Pa /var/run/utmp
115accounting
116.Dp Pa /var/log/wtmp
117accounting
118.Dp Pa /var/mail/*
119mail
120.Dp Pa /etc/motd
121message-of-the-day
122.Dp Pa /etc/passwd
123password file
124.Dp Pa /etc/nologin
125stops logins
126.Dp Pa \&.hushlogin
127makes login quieter
128.Dp
129.Sh SEE ALSO
130.Xr mail 1 ,
131.Xr passwd 1 ,
132.Xr rlogin 1 ,
133.Xr getpass 3 ,
134.Xr passwd 5 ,
135.Xr utmp 5 ,
136.Xr environ 7 ,
137.Xr init 8 ,
138.Xr getty 8 ,
139.Xr shutdown 8 ,
140.Sh HISTORY
141.Nm login
142appeared in Version 6 AT&T Unix.
143.Sh DIAGNOSTICS
144.Dw Fl
145.Di L
146.Dp Li Login incorrect
55890414 147if the name or the password is bad.
3c003a08
CL
148.Dp Li No Shell
149.Dp Li cannot open password file
150.Dp Li no directory
55890414 151consult a programming counselor.
3c003a08 152.Dp