Commit | Line | Data |
---|---|---|
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 | 23 | The |
3c003a08 | 24 | .Nm login |
55890414 KM |
25 | command |
26 | is used when a user initially | |
7ed14798 MK |
27 | signs on. |
28 | It may also be used at any time to change | |
55890414 | 29 | from one user to another. |
7ed14798 | 30 | This case is the one summarized first above and described here. |
3c003a08 CL |
31 | See |
32 | .Em How to Get Started | |
33 | for how to connect initially. | |
7ed14798 | 34 | The invocation of |
3c003a08 | 35 | .Nm login |
7ed14798 MK |
36 | for initial sign-on |
37 | is made by a system program or server using the latter form of the command | |
38 | and is described below. | |
3c003a08 | 39 | .Pp |
55890414 | 40 | If |
3c003a08 | 41 | .Nm login |
55890414 KM |
42 | is invoked without an argument, |
43 | it asks for a user name, and, if | |
44 | appropriate, a password. | |
45 | Echoing is turned off (if possible) during the typing of the password, | |
46 | so it will not appear on the written record of the | |
47 | session. | |
3c003a08 | 48 | .Pp |
55890414 KM |
49 | After a successful login, |
50 | accounting files are updated and | |
51 | the user is informed of the | |
678ce1ab MK |
52 | existence of mail. |
53 | The message of the day is printed, | |
54 | as is the time of his last login. | |
3c003a08 CL |
55 | Both are suppressed if he has a |
56 | .Dq Pa .hushlogin | |
678ce1ab | 57 | file in his home directory; this |
55890414 | 58 | is 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 |
62 | initializes the user and group IDs and the working directory, |
63 | then executes a command interpreter (usually | |
3c003a08 | 64 | .Xr csh 1 ) |
55890414 | 65 | according to specifications found in a password file. |
678ce1ab MK |
66 | Argument 0 of the command interpreter is |
67 | the name of the command interpreter with | |
3c003a08 CL |
68 | a leading dash |
69 | .Sq Fl . | |
70 | .Pp | |
06ae098a | 71 | Login also modifies the |
55890414 | 72 | environment |
3c003a08 | 73 | .Xr environ 7 |
55890414 KM |
74 | with information specifying home directory, command interpreter, terminal |
75 | type (if available) and user name. | |
3c003a08 CL |
76 | .Pp |
77 | Options: | |
78 | .Pp | |
79 | .Tw Fl | |
80 | .Tp Fl p | |
81 | Causes the remainder of the environment to be preserved, | |
678ce1ab | 82 | otherwise any previous environment is discarded. |
3c003a08 | 83 | .Tp Fl h |
7ed14798 | 84 | option is used by |
3c003a08 CL |
85 | .Ar telnetd 8 |
86 | (at initial login) | |
7ed14798 MK |
87 | and other servers to list the host from which |
88 | the connection was received. | |
3c003a08 CL |
89 | .Tp Fl f |
90 | Used with a username on the command line, at initial login, | |
7ed14798 MK |
91 | to indicate that proper authentication has already been done |
92 | and that no password need be requested. | |
93 | This option may be used by the superuser | |
94 | or by the user specified on the command line. | |
3c003a08 CL |
95 | .Tp |
96 | .Pp | |
97 | If the file | |
98 | .Pa /etc/nologin | |
99 | exists, | |
100 | .Nm login | |
101 | prints its contents on the user's terminal and exits. This is | |
102 | used by | |
103 | .Xr shutdown 8 | |
104 | to stop users logging in when the system is about to go down. | |
105 | .Pp | |
106 | Login is recognized by | |
107 | .Xr sh 1 | |
108 | and | |
109 | .Xr csh 1 | |
110 | and executed directly (without forking). | |
111 | .Sh FILES | |
112 | .Dw /var/log/wtmp | |
113 | .Di L | |
114 | .Dp Pa /var/run/utmp | |
115 | accounting | |
116 | .Dp Pa /var/log/wtmp | |
117 | accounting | |
118 | .Dp Pa /var/mail/* | |
119 | ||
120 | .Dp Pa /etc/motd | |
121 | message-of-the-day | |
122 | .Dp Pa /etc/passwd | |
123 | password file | |
124 | .Dp Pa /etc/nologin | |
125 | stops logins | |
126 | .Dp Pa \&.hushlogin | |
127 | makes 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 | |
142 | appeared in Version 6 AT&T Unix. | |
143 | .Sh DIAGNOSTICS | |
144 | .Dw Fl | |
145 | .Di L | |
146 | .Dp Li Login incorrect | |
55890414 | 147 | if 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 | 151 | consult a programming counselor. |
3c003a08 | 152 | .Dp |