less -> more
[unix-history] / usr / src / usr.bin / su / su.1
CommitLineData
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 21su \- 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
27login is provided), and switches to that user and group ID. A shell is
28then invoked.
a8d8c335 29.PP
6964f298
KB
30By default, your environment is unmodified with the exception of
31\fIUSER\fP, \fIHOME\fP, and \fISHELL\fP. \fIHOME\fP and \fISHELL\fP
32are set to the target login's \fI/etc/passwd\fP values. \fIUSER\fP
33is set to the target login, unless the target login has a UID of 0,
34in which case it is unmodified. The invoked shell is the target
35login's. This is the traditional behavior of \fIsu\fP.
a8d8c335 36.PP
6964f298
KB
37The \fI-l\fP option simulates a full login. The environment is discarded
38except 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
40the target login. \fIPATH\fP is set to ``/usr/ucb:/bin:/usr/bin''.
41\fITERM\fP is imported from your current environment. The invoked shell
42is the target login's, and \fIsu\fP will change directory to the target
43login's home directory.
a8d8c335 44.PP
6964f298
KB
45The \fI-m\fP option causes the environment to remain unmodified, and
46the invoked shell to be your login shell. No directory changes are
7b34c4f8
KB
47made. As a security precaution, if the target shell is not a standard
48shell (as defined by \fIgetusershell\fP(3)) it is invoked instead of
49your login shell.
7d4168b6 50.PP
6964f298
KB
51If the invoked shell is \fIcsh\fP, the \fI-f\fP option prevents it from
52reading the \fI.cshrc\fP file. Otherwise, this option is ignored.
a8d8c335 53.PP
6964f298 54Only users in group 0 (normally ``wheel'') can \fIsu\fP to ``root''.
a8d8c335 55.PP
6964f298
KB
56By default (unless the prompt is reset by a startup file) the super-user
57prompt is set to ``#'' to remind one of its awesome power.
7d4168b6 58.SH "SEE ALSO"
6964f298 59csh(1), login(1), sh(1), passwd(5), group(5), environ(7)