4.1 The “su” command

The su (substitute user or switch user) command permits a user to temporarily elevate to a root user. When used by itself without any arguments, the su command prompts for the password of the root account. Once successfully authenticated, a user enters the shell of the root account.

Note that the elevation stays until the user use the exit command to return to the original user account.

One problem with using su is that if a user does elevate to the root account, and forgets to exit after performing administrative work, another person can come along and continue the command line interface session as root. In other words, the su command has no time out feature to exit the switched user mode.

In some systems, most notably Ubuntu, su does not even work by default. This is because the root account has no default password. In Linux, an account without a password means on one can log in to that account, which is the safest assumption.