Beginner Package: util-linux / shadow-utils

su

Switch to another user account within the current session.

Syntax

su [options] [username]

Description

su starts a new shell as another user (root, if no username is given), prompting for that user's password. Unlike sudo it switches your whole session rather than running one privileged command.

Examples

su -
Switch to root, loading root's full environment (the trailing dash matters)
su alice
Switch to another user's account
exit
Return to your original session
On distributions where the root account has no password set (default on Ubuntu), su root will not work until sudo passwd root is run โ€” sudo is the standard route instead.

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux