su - substitute user identity


su [-flm] [login [arguments]]


The su(1) utility requests the password for login (or for login.root, if no login is provided), and switches to that user and group identifier (ID) after obtaining the information. It then executes the login shell of login. If the optional arguments are provided on the command line, they are passed to the shell.

If su(1) is executed by Administrator, no password is requested, and a shell with the appropriate user ID is executed.

When you type su at the shell prompt, it is equivalent to typing su Administrator.

By default, the environment is unmodified with the exception of USER, HOME, and SHELL. HOME and SHELL are set to the target login's default values. The invoked shell is the target login's. This is the traditional behavior of su(1).

The options are as follows:

If the invoked shell is csh(1), this option prevents it from reading the .cshrc file.
Simulate 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 /bin:/usr/bin. TERM is imported from your current environment. The invoked shell is the target login's; su(1) will change directory to the target login's home directory.
Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made.

The -l and -m options are mutually exclusive; the last one specified overrides any previous ones.

By default (unless the prompt is reset by a startup file) the superuser prompt is set to # to distinguish it from the standard C shell or Korn shell prompt.


Environment variables used by su(1):

Default home directory of real user ID unless modified as specified above.
Default search path of real user ID unless modified as specified above.
Provides terminal type that can be retained for the substituted user ID.
The user ID is always the effective ID (the target user ID) after su(1) has been used to substitute a user identity.