The su (set user or super user) command allows a user to become another user without logging out.
Sudo (on systems that support sudo) also elevates a command to the effective rights of the root user which is also a supported option for installation.
The su command executes a new shell with the real and effective user id being consistent with that of the specified user. Commands then ran within this shell are executed with the new user's privileges. However, the environment is still based off the original users environment with the exception of $PATH, $PS1. The environment variables for $HOME and $ENV are removed. This is because the shell being initiated is a subshell of the existing environment. The new userid you are su'ing will not have gone through the login process.
Command syntax:
su userid
Example: su root
If su is used with the (-) hyphen option to the su command, then the new shell is initiated as if the user had logged into the system originally. The login scripts associated with the new userid are executed and configure the environment to that of the new userid being specified. This includes $HOME, $PATH and $PS1.
Command syntax:
su - userid
Example: su - root
Notes:
- Using the hyphen option ( "su -") is recommended. This ensure that the environment that the Progress installation is being executed in uses the same environment that the root user would have when actually logging into the system.
- The installer must be run as root. See Can I install progress as a non-root user? for more details.