SU(1) COMMAND REFERENCE SU(1)
NAME
su - substitute userid temporarily
SYNOPSIS
su [ - ] [ -e ] [ -f ] [ username ]
DESCRIPTION
Su demands the password of the specified username, and if it
is given, changes to that username and invokes the Shell
sh(1sh) without changing the current directory. The user
environment is unchanged except for HOME and SHELL, which
are taken from the password file for the user being
substituted (see environ(7)), unless the -e option is given.
The new userid stays in force until the Shell exits.
If no username is specified, root is assumed. To remind the
superuser of his or her responsibilities, the Shell
substitutes # for its usual prompt.
When a user attempts to su to root (or any username with a
userid of 0), the attempt is reported to the system via
syslog(3c). This applies to all attempts, including those
where an invalid password is given.
OPTIONS
- Execute the shell as -su, causing the startup file (
.profile or .login) to be read.
-e Use the original user's environment. With this option,
the substituted user's powers are given, but the user
uses current environment variables and aliases (only in
csh(1csh)).
-f Execute the shell with the -f flag. (This only works
with csh(1csh)).
VARIABLES
HOME The home directory for the given username.
SHELL The login shell for the given username.
USER The given username.
TERM The type of terminal being used.
RETURN VALUE
The exit code for a successful execution of su is that of
the shell that was executed.
[1] The username given is not in the password
file.
Printed 10/17/86 1
SU(1) COMMAND REFERENCE SU(1)
[2] The password given was incorrect.
[3] The groupid for the given username could not
be set.
[4] The groups for the username could not be set.
[5] The username could not be set.
[6] Could not change directory to the home
directory for the given username.
[7] The shell program could not be executed.
[NP_ERR] An error occurred that was not a system
error. Execution terminated.
CAVEATS
When substituting a username which has no execute or read
permission in the current directory, the shell may not be
able to execute commands from the startup file. Su can not
check for this possibility, since some username's do not
execute shells.
If the basename of the shell to be executed is not csh, the
-f option is ignored.
SEE ALSO
csh(1csh), sh(1sh), environ(7).
Printed 10/17/86 2
%%index%%
na:72,70;
sy:142,157;
de:299,1089;
op:1388,570;
va:1958,284;
rv:2242,278;2664,556;
ca:3220,460;
se:3680,150;
%%index%%000000000142