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