]>
Commit | Line | Data |
---|---|---|
1815bff5 A |
1 | .\" Copyright (c) 1980, 1990, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
3 | .\" | |
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. | |
19 | .\" | |
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. | |
31 | .\" | |
32 | .\" @(#)login.1 8.2 (Berkeley) 5/5/94 | |
ef8ad44b | 33 | .\" $FreeBSD: src/usr.bin/login/login.1,v 1.33 2007/11/30 11:02:36 philip Exp $ |
1815bff5 | 34 | .\" |
ef8ad44b | 35 | .Dd September 13, 2006 |
1815bff5 | 36 | .Dt LOGIN 1 |
ef8ad44b | 37 | .Os |
1815bff5 A |
38 | .Sh NAME |
39 | .Nm login | |
40 | .Nd log into the computer | |
41 | .Sh SYNOPSIS | |
ef8ad44b | 42 | .Nm |
34d340d7 | 43 | .Op Fl pq |
1815bff5 A |
44 | .Op Fl h Ar hostname |
45 | .Op Ar user | |
ef8ad44b | 46 | .Nm |
34d340d7 A |
47 | .Fl f |
48 | .Op Fl lpq | |
49 | .Op Fl h Ar hostname | |
50 | .Op Ar user Op Ar prog Op Ar args... | |
1815bff5 A |
51 | .Sh DESCRIPTION |
52 | The | |
ef8ad44b | 53 | .Nm |
1815bff5 A |
54 | utility logs users (and pseudo-users) into the computer system. |
55 | .Pp | |
56 | If no user is specified, or if a user is specified and authentication | |
57 | of the user fails, | |
ef8ad44b | 58 | .Nm |
1815bff5 | 59 | prompts for a user name. |
ef8ad44b A |
60 | Authentication of users is configurable via |
61 | .Xr pam 8 . | |
62 | Password authentication is the default. | |
1815bff5 | 63 | .Pp |
ef8ad44b A |
64 | The following options are available: |
65 | .Bl -tag -width indent | |
1815bff5 | 66 | .It Fl f |
ef8ad44b | 67 | When a user name is specified, this option indicates that proper |
1815bff5 A |
68 | authentication has already been done and that no password need be |
69 | requested. | |
70 | This option may only be used by the super-user or when an already | |
71 | logged in user is logging in as themselves. | |
34d340d7 A |
72 | .Pp |
73 | With the | |
74 | .Fl f | |
75 | option, an alternate program (and any arguments) may be run instead of the | |
76 | user's default shell. | |
77 | The program and arguments follows the user name. | |
1815bff5 | 78 | .It Fl h |
ef8ad44b | 79 | Specify the host from which the connection was received. |
1815bff5 | 80 | It is used by various daemons such as |
ef8ad44b | 81 | .Xr telnetd 8 . |
1815bff5 | 82 | This option may only be used by the super-user. |
34d340d7 A |
83 | .It Fl l |
84 | Tells the program executed by | |
ef8ad44b | 85 | .Nm |
34d340d7 A |
86 | that this is not a login session (by convention, a login session is |
87 | signalled to the program with a hyphen as the first character of | |
88 | .Em argv[0] ; | |
89 | this option disables that), and prevents it from chdir(2)ing to the user's home directory. | |
90 | The default is to add the hyphen (this is a login session). | |
1815bff5 A |
91 | .It Fl p |
92 | By default, | |
ef8ad44b | 93 | .Nm |
1815bff5 A |
94 | discards any previous environment. |
95 | The | |
96 | .Fl p | |
97 | option disables this behavior. | |
34d340d7 A |
98 | .It Fl q |
99 | This forces quiet logins, as if a | |
100 | .Pa .hushlogin | |
101 | is present. | |
1815bff5 A |
102 | .El |
103 | .Pp | |
104 | If the file | |
105 | .Pa /etc/nologin | |
106 | exists, | |
ef8ad44b | 107 | .Nm |
1815bff5 A |
108 | dislays its contents to the user and exits. |
109 | This is used by | |
110 | .Xr shutdown 8 | |
111 | to prevent users from logging in when the system is about to go down. | |
112 | .Pp | |
113 | Immediately after logging a user in, | |
ef8ad44b | 114 | .Nm |
1815bff5 A |
115 | displays the system copyright notice, the date and time the user last |
116 | logged in, the message of the day as well as other information. | |
117 | If the file | |
ef8ad44b A |
118 | .Pa .hushlogin |
119 | exists in the user's home directory, all of these messages are suppressed. | |
34d340d7 A |
120 | .Fl q |
121 | is specified, all of these messages are suppressed. | |
1815bff5 A |
122 | This is to simplify logins for non-human users, such as |
123 | .Xr uucp 1 . | |
ef8ad44b | 124 | .Nm |
34d340d7 A |
125 | then records an entry in |
126 | .Xr utmpx 5 | |
127 | and the like, and executes the user's command interpreter (or the program | |
128 | specified on the command line if | |
129 | .Fl f | |
130 | is specified). | |
1815bff5 | 131 | .Pp |
ef8ad44b A |
132 | The |
133 | .Nm | |
134 | utility enters information into the environment (see | |
1815bff5 A |
135 | .Xr environ 7 ) |
136 | specifying the user's home directory (HOME), command interpreter (SHELL), | |
137 | search path (PATH), terminal type (TERM) and user name (both LOGNAME and | |
138 | USER). | |
139 | .Pp | |
ef8ad44b A |
140 | Some shells may provide a builtin |
141 | .Nm | |
142 | command which is similar or identical to this utility. | |
143 | Consult the | |
144 | .Xr builtin 1 | |
145 | manual page. | |
146 | .Pp | |
147 | The | |
148 | .Nm | |
149 | utility will submit an audit record when login succeeds or fails. | |
150 | Failure to determine the current auditing state will | |
151 | result in an error exit from | |
152 | .Nm . | |
1815bff5 A |
153 | .Sh FILES |
154 | .Bl -tag -width /var/mail/userXXX -compact | |
155 | .It Pa /etc/motd | |
156 | message-of-the-day | |
157 | .It Pa /etc/nologin | |
158 | disallows logins | |
34d340d7 | 159 | .It Pa /var/run/utmpx |
1815bff5 | 160 | current logins |
1815bff5 A |
161 | .It Pa /var/mail/user |
162 | system mailboxes | |
163 | .It Pa \&.hushlogin | |
164 | makes login quieter | |
ef8ad44b A |
165 | .It Pa /etc/pam.d/login |
166 | .Xr pam 8 | |
167 | configuration file | |
168 | .It Pa /etc/security/audit_user | |
169 | user flags for auditing | |
170 | .It Pa /etc/security/audit_control | |
171 | global flags for auditing | |
1815bff5 A |
172 | .El |
173 | .Sh SEE ALSO | |
ef8ad44b | 174 | .Xr builtin 1 , |
1815bff5 | 175 | .Xr chpass 1 , |
ef8ad44b | 176 | .Xr newgrp 1 , |
1815bff5 A |
177 | .Xr passwd 1 , |
178 | .Xr rlogin 1 , | |
179 | .Xr getpass 3 , | |
34d340d7 A |
180 | .Xr utmpx 5 , |
181 | .Xr environ 7 | |
1815bff5 A |
182 | .Sh HISTORY |
183 | A | |
ef8ad44b A |
184 | .Nm |
185 | utility appeared in | |
1815bff5 | 186 | .At v6 . |