1 .\" Copyright (c) 1988, 1990, 1993, 1994
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
32 .\" @(#)su.1 8.2 (Berkeley) 4/18/94
35 .\" this is for hilit19's braindeadness: "
41 .Nd substitute user identity
47 .Op Ar login Op Ar args
50 requests the Kerberos password for
53 .Dq Ar login Ns .root ,
54 if no login is provided), and switches to
55 that user and group ID after obtaining a Kerberos ticket granting ticket.
56 A shell is then executed.
58 will resort to the local password file to find the password for
60 if there is a Kerberos error.
63 is executed by root, no password is requested and a shell
64 with the appropriate user ID is executed; no additional Kerberos tickets
67 By default, the environment is unmodified with the exception of
75 are set to the target login's default values.
77 is set to the target login, unless the target login has a user ID of 0,
78 in which case it is unmodified.
79 The invoked shell is the target login's.
80 This is the traditional behavior of
82 Resource limits and session priority applicable to the original user's
85 are also normally retained unless the target login as a user ID of 0.
87 The options are as follows:
90 Do not attempt to use Kerberos to authenticate the user.
92 If the invoked shell is
94 this option prevents it from reading the
98 Simulate a full login.
99 The environment is discarded except for
109 are modified as above.
111 is set to the target login.
114 .Dq Pa /bin:/usr/bin .
116 is imported from your current environment.
117 Environment variables may be set or overridden from the login class
118 capabilities database according to the class of the target login.
119 The invoked shell is the target login's, and
121 will change directory to the target login's home directory.
122 Resource limits and session priority are modified to that for the
123 target account's login class.
125 (no letter) The same as
128 Leave the environment unmodified.
129 The invoked shell is your login shell, and no directory changes are made.
130 As a security precaution, if the target user's shell is a non-standard
133 and the caller's real uid is
138 Use the settings of the specified login class.
139 Only allowed for the super-user.
149 options are mutually exclusive; the last one specified
150 overrides any previous ones.
154 are provided on the command line, they are passed to the login shell of
157 Only users who are a member of group 0 (normally
163 \ If group 0 is missing or empty, any user can
168 By default (unless the prompt is reset by a startup file) the super-user
171 to remind one of its awesome power.
173 .Bl -tag -width /etc/auth.conf -compact
174 .It Pa /etc/auth.conf
175 configure authentication services
179 is configured with PAM support, it uses
181 entries with service name
195 Environment variables used by
199 Default home directory of real user ID unless modified as
202 Default search path of real user ID unless modified as specified above.
204 Provides terminal type which may be retained for the substituted
207 The user ID is always the effective ID (the target user ID) after an
209 unless the user ID is 0 (root).
212 .Bl -tag -width 5n -compact
213 .It Li "su man -c catman"
218 You will be asked for man's password unless your real UID is 0.
219 .It Li "su man -c 'catman /usr/share/man /usr/local/man /usr/X11R6/man'"
220 Same as above, but the target command constitutes of more than a
221 single word and hence is quoted for use with the
223 option being passed to the shell. (Most shells expect the argument to
225 to be a single word).
226 .It Li "su -c staff man -c 'catman /usr/share/man /usr/local/man /usr/X11R6/man'"
227 Same as above, but the target command is run with the resource limits of
230 Note: in this example, the first
234 while the second is an argument to the shell being invoked.
236 Simulate a login for user foo.
240 Simulate a login for root.