SU(1) — UNIX 3.0
NAME
su − become super-user or another user
SYNOPSIS
su [ − ] [ name [ arg ... ] ]
DESCRIPTION
Su allows one to become another user without logging off. The default user name is root (i.e., super-user).
To use su, the appropriate password must be supplied (unless one is already super-user). If the password is correct, su will execute a new shell with the user ID set to that of the specified user. To restore normal user ID privileges, type an EOF to the new shell.
Any additional arguments are passed to the shell, permitting the super-user to run shell procedures with restricted privileges (an arg of the form −c string executes string via the shell). When additional arguments are passed, /bin/sh is always used. When no additional arguments are passed, su uses the shell specified in the password file.
An initial − flag causes the environment to be changed to the one that would be expected if the user actually logged in again. This is done by invoking the shell with an arg0 of −su causing the .profile in the home directory of the new user ID to be executed. Otherwise, the environment is passed along with the possible exception of $PATH, which is set to /bin:/etc:/usr/bin for root. Note that the .profile can check arg0 for −sh or −su to determine how it was invoked.
FILES
/etc/passwdsystem’s password file
$HOME/.profileuser’s profile
SEE ALSO
env(1), login(1), sh(1), environ(7).
May 16, 1980