The su command allows a user to run commands with the privileges of another user, by default the root user. This allows a user to switch to the administrative account without logging in directly as root. The su command can be used to run an interactive shell or individual commands as the root user. Alternatively, the sudo command can be used to run commands as root by entering the user's own password, avoiding the need to share the root password.