]> git.saurik.com Git - apple/system_cmds.git/blame - login.tproj/login.1
system_cmds-433.8.tar.gz
[apple/system_cmds.git] / login.tproj / login.1
CommitLineData
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
33.\"
34.Dd May 5, 1994
35.Dt LOGIN 1
36.Os BSD 4
37.Sh NAME
38.Nm login
39.Nd log into the computer
40.Sh SYNOPSIS
41.Nm login
34d340d7 42.Op Fl pq
1815bff5
A
43.Op Fl h Ar hostname
44.Op Ar user
34d340d7
A
45.Nm login
46.Fl f
47.Op Fl lpq
48.Op Fl h Ar hostname
49.Op Ar user Op Ar prog Op Ar args...
1815bff5
A
50.Sh DESCRIPTION
51The
52.Nm login
53utility logs users (and pseudo-users) into the computer system.
54.Pp
55If no user is specified, or if a user is specified and authentication
56of the user fails,
57.Nm login
58prompts for a user name.
59Authentication of users is done via passwords.
60.Pp
61The options are as follows:
62.Bl -tag -width Ds
34d340d7 63.\" ==========
1815bff5
A
64.It Fl f
65The
66.Fl f
67option is used when a user name is specified to indicate that proper
68authentication has already been done and that no password need be
69requested.
70This option may only be used by the super-user or when an already
71logged in user is logging in as themselves.
34d340d7
A
72.Pp
73With the
74.Fl f
75option, an alternate program (and any arguments) may be run instead of the
76user's default shell.
77The program and arguments follows the user name.
78.\" ==========
1815bff5
A
79.It Fl h
80The
81.Fl h
82option specifies the host from which the connection was received.
83It is used by various daemons such as
84.Xr telnetd 8 .
85This option may only be used by the super-user.
34d340d7
A
86.\" ==========
87.It Fl l
88Tells the program executed by
89.Nm login
90that this is not a login session (by convention, a login session is
91signalled to the program with a hyphen as the first character of
92.Em argv[0] ;
93this option disables that), and prevents it from chdir(2)ing to the user's home directory.
94The default is to add the hyphen (this is a login session).
95.\" ==========
1815bff5
A
96.It Fl p
97By default,
98.Nm login
99discards any previous environment.
100The
101.Fl p
102option disables this behavior.
34d340d7
A
103.\" ==========
104.It Fl q
105This forces quiet logins, as if a
106.Pa .hushlogin
107is present.
1815bff5
A
108.El
109.Pp
110If the file
111.Pa /etc/nologin
112exists,
113.Nm login
114dislays its contents to the user and exits.
115This is used by
116.Xr shutdown 8
117to prevent users from logging in when the system is about to go down.
118.Pp
119Immediately after logging a user in,
120.Nm login
121displays the system copyright notice, the date and time the user last
122logged in, the message of the day as well as other information.
123If the file
124.Dq Pa .hushlogin
34d340d7
A
125exists in the user's home directory or
126.Fl q
127is specified, all of these messages are suppressed.
1815bff5
A
128This is to simplify logins for non-human users, such as
129.Xr uucp 1 .
130.Nm Login
34d340d7
A
131then records an entry in
132.Xr utmpx 5
133and the like, and executes the user's command interpreter (or the program
134specified on the command line if
135.Fl f
136is specified).
1815bff5
A
137.Pp
138Login enters information into the environment (see
139.Xr environ 7 )
140specifying the user's home directory (HOME), command interpreter (SHELL),
141search path (PATH), terminal type (TERM) and user name (both LOGNAME and
142USER).
143.Pp
144The standard shells,
145.Xr csh 1
146and
147.Xr sh 1 ,
148do not fork before executing the
149.Nm login
150utility.
151.Sh FILES
152.Bl -tag -width /var/mail/userXXX -compact
153.It Pa /etc/motd
154message-of-the-day
155.It Pa /etc/nologin
156disallows logins
34d340d7 157.It Pa /var/run/utmpx
1815bff5 158current logins
1815bff5
A
159.It Pa /var/mail/user
160system mailboxes
161.It Pa \&.hushlogin
162makes login quieter
163.El
164.Sh SEE ALSO
165.Xr chpass 1 ,
166.Xr passwd 1 ,
167.Xr rlogin 1 ,
168.Xr getpass 3 ,
34d340d7
A
169.Xr utmpx 5 ,
170.Xr environ 7
1815bff5
A
171.Sh HISTORY
172A
173.Nm login
174appeared in
175.At v6 .