Commit | Line | Data |
---|---|---|
6964f298 KB |
1 | .\" Copyright (c) 1988 The Regents of the University of California. |
2 | .\" All rights reserved. | |
7d4168b6 | 3 | .\" |
6964f298 KB |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
7b34c4f8 | 16 | .\" @(#)su.1 6.6 (Berkeley) %G% |
7d4168b6 | 17 | .\" |
d9fd65e7 | 18 | .TH SU 1 "" |
7d4168b6 KM |
19 | .UC |
20 | .SH NAME | |
a8d8c335 | 21 | su \- substitute user id |
7d4168b6 KM |
22 | .SH SYNOPSIS |
23 | .B su | |
6964f298 | 24 | [-flm] [login] |
7d4168b6 | 25 | .SH DESCRIPTION |
6964f298 KB |
26 | \fISu\fP requests the password for \fIlogin\fP (or for ``root'', if no |
27 | login is provided), and switches to that user and group ID. A shell is | |
28 | then invoked. | |
a8d8c335 | 29 | .PP |
6964f298 KB |
30 | By default, your environment is unmodified with the exception of |
31 | \fIUSER\fP, \fIHOME\fP, and \fISHELL\fP. \fIHOME\fP and \fISHELL\fP | |
32 | are set to the target login's \fI/etc/passwd\fP values. \fIUSER\fP | |
33 | is set to the target login, unless the target login has a UID of 0, | |
34 | in which case it is unmodified. The invoked shell is the target | |
35 | login's. This is the traditional behavior of \fIsu\fP. | |
a8d8c335 | 36 | .PP |
6964f298 KB |
37 | The \fI-l\fP option simulates a full login. The environment is discarded |
38 | except for \fIHOME\fP, \fISHELL\fP, \fIPATH\fP, \fITERM\fP, and \fIUSER\fP. | |
39 | \fIHOME\fP and \fISHELL\fP are modified as above. \fIUSER\fP is set to | |
40 | the target login. \fIPATH\fP is set to ``/usr/ucb:/bin:/usr/bin''. | |
41 | \fITERM\fP is imported from your current environment. The invoked shell | |
42 | is the target login's, and \fIsu\fP will change directory to the target | |
43 | login's home directory. | |
a8d8c335 | 44 | .PP |
6964f298 KB |
45 | The \fI-m\fP option causes the environment to remain unmodified, and |
46 | the invoked shell to be your login shell. No directory changes are | |
7b34c4f8 KB |
47 | made. As a security precaution, if the target shell is not a standard |
48 | shell (as defined by \fIgetusershell\fP(3)) it is invoked instead of | |
49 | your login shell. | |
7d4168b6 | 50 | .PP |
6964f298 KB |
51 | If the invoked shell is \fIcsh\fP, the \fI-f\fP option prevents it from |
52 | reading the \fI.cshrc\fP file. Otherwise, this option is ignored. | |
a8d8c335 | 53 | .PP |
6964f298 | 54 | Only users in group 0 (normally ``wheel'') can \fIsu\fP to ``root''. |
a8d8c335 | 55 | .PP |
6964f298 KB |
56 | By default (unless the prompt is reset by a startup file) the super-user |
57 | prompt is set to ``#'' to remind one of its awesome power. | |
7d4168b6 | 58 | .SH "SEE ALSO" |
6964f298 | 59 | csh(1), login(1), sh(1), passwd(5), group(5), environ(7) |