xref: /original-bsd/usr.bin/su/su.1 (revision 92d853e2)
Copyright (c) 1988 The Regents of the University of California.
All rights reserved.

Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the University of California, Berkeley. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

@(#)su.1 6.7 (Berkeley) 12/07/88

SU 1 ""
C
NAME
su - substitute user id
SYNOPSIS
su [-flm] [login]
DESCRIPTION
Su requests the password for login (or for ``root'', if no login is provided), and switches to that user and group ID. A shell is then invoked.

By default, your environment is unmodified with the exception of USER, HOME, and SHELL. HOME and SHELL are set to the target login's /etc/passwd values. USER is set to the target login, unless the target login has a UID of 0, in which case it is unmodified. The invoked shell is the target login's. This is the traditional behavior of su.

The -l option simulates a full login. The environment is discarded except for HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified as above. USER is set to the target login. PATH is set to ``/usr/ucb:/bin:/usr/bin''. TERM is imported from your current environment. The invoked shell is the target login's, and su will change directory to the target login's home directory.

The -m option causes the environment to remain unmodified, and the invoked shell to be your login shell. No directory changes are made. As a security precaution, if the -m option is specified, the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non-zero, su will fail.

If the invoked shell is csh, the -f option prevents it from reading the .cshrc file. Otherwise, this option is ignored.

Only users in group 0 (normally ``wheel'') can su to ``root''.

By default (unless the prompt is reset by a startup file) the super-user prompt is set to ``#'' to remind one of its awesome power.

"SEE ALSO"
csh(1), login(1), sh(1), passwd(5), group(5), environ(7)