]>
Commit | Line | Data |
---|---|---|
44bd5ea7 A |
1 | .\" Copyright (c) 1988, 1990, 1993, 1994 |
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 | .\" from: @(#)su.1 8.2 (Berkeley) 4/18/94 | |
33 | .\" $NetBSD: su.1,v 1.14 1997/10/19 23:31:52 lukem Exp $ | |
34 | .\" | |
35 | .Dd April 18, 1994 | |
36 | .Dt SU 1 | |
37 | .Os | |
38 | .Sh NAME | |
39 | .Nm su | |
40 | .Nd substitute user identity | |
41 | .Sh SYNOPSIS | |
42 | .Nm | |
c0fcf4e1 A |
43 | .Op Fl flm |
44 | .Op Ar login | |
45 | .Op Ar -c shell arguments | |
44bd5ea7 A |
46 | .Sh DESCRIPTION |
47 | .Nm | |
c0fcf4e1 | 48 | requests the password for |
44bd5ea7 | 49 | .Ar login |
c0fcf4e1 A |
50 | and switches to |
51 | that user and group ID after obtaining proper authentication. | |
44bd5ea7 A |
52 | A shell is then executed, and any additional |
53 | .Ar "shell arguments" | |
54 | after the login name | |
55 | are passed to the shell. | |
44bd5ea7 A |
56 | If |
57 | .Nm | |
58 | is executed by root, no password is requested and a shell | |
c0fcf4e1 | 59 | with the appropriate user ID is executed. |
44bd5ea7 A |
60 | .Pp |
61 | The options are as follows: | |
62 | .Bl -tag -width Ds | |
c0fcf4e1 A |
63 | .It Fl c |
64 | Invoke the following command in a subshell as the specified user. | |
44bd5ea7 A |
65 | .It Fl f |
66 | If the invoked shell is | |
67 | .Xr csh 1 , | |
68 | this option prevents it from reading the | |
69 | .Dq Pa .cshrc | |
70 | file. | |
71 | .It Fl l | |
72 | Simulate a full login. | |
73 | The environment is discarded except for | |
74 | .Ev HOME , | |
75 | .Ev SHELL , | |
76 | .Ev PATH , | |
77 | .Ev TERM , | |
78 | and | |
79 | .Ev USER . | |
80 | .Ev HOME | |
81 | and | |
82 | .Ev SHELL | |
83 | are modified as above. | |
84 | .Ev USER | |
85 | is set to the target login. | |
86 | .Ev PATH | |
87 | is set to | |
88 | .Dq Pa /bin:/usr/bin . | |
89 | .Ev TERM | |
90 | is imported from your current environment. | |
91 | The invoked shell is the target login's, and | |
92 | .Nm | |
93 | will change directory to the target login's home directory. | |
c0fcf4e1 | 94 | This option is identical to just passing "-", as in "su -". |
44bd5ea7 A |
95 | .It Fl m |
96 | Leave the environment unmodified. | |
97 | The invoked shell is your login shell, and no directory changes are made. | |
98 | As a security precaution, if the target user's shell is a non-standard | |
99 | shell (as defined by | |
100 | .Xr getusershell 3 ) | |
101 | and the caller's real uid is | |
102 | non-zero, | |
103 | .Nm | |
104 | will fail. | |
105 | .El | |
106 | .Pp | |
107 | The | |
108 | .Fl l | |
109 | and | |
110 | .Fl m | |
111 | options are mutually exclusive; the last one specified | |
112 | overrides any previous ones. | |
113 | .Pp | |
114 | Only users in group | |
115 | .Dq wheel | |
c0fcf4e1 A |
116 | (normally gid 0) |
117 | or group | |
118 | .Dq admin | |
119 | (normally gid 20) can | |
44bd5ea7 A |
120 | .Nm |
121 | to | |
122 | .Dq root . | |
123 | .Pp | |
124 | By default (unless the prompt is reset by a startup file) the super-user | |
125 | prompt is set to | |
126 | .Dq Sy \&# | |
127 | to remind one of its awesome power. | |
128 | .Sh SEE ALSO | |
129 | .Xr csh 1 , | |
130 | .Xr login 1 , | |
131 | .Xr sh 1 , | |
132 | .Xr skey 1 , | |
133 | .Xr kinit 1 , | |
134 | .Xr kerberos 1 , | |
135 | .Xr passwd 5 , | |
136 | .Xr group 5 , | |
137 | .Xr environ 7 | |
138 | .Sh ENVIRONMENT | |
139 | Environment variables used by | |
140 | .Nm | |
141 | : | |
142 | .Bl -tag -width "HOME" | |
143 | .It Ev HOME | |
144 | Default home directory of real user ID unless modified as | |
145 | specified above. | |
146 | .It Ev PATH | |
147 | Default search path of real user ID unless modified as specified above. | |
148 | .It Ev TERM | |
149 | Provides terminal type which may be retained for the substituted | |
150 | user ID. | |
151 | .It Ev USER | |
152 | The user ID is always the effective ID (the target user ID) after an | |
153 | .Nm | |
154 | unless the user ID is 0 (root). | |
155 | .El | |
156 | .Sh HISTORY | |
157 | A | |
158 | .Nm | |
159 | command appeared in | |
160 | .At v7 . |