User Management

su

Switch user identity — run a shell as another user.

Synopsis

syntax
su [OPTION]... [USER]

Examples

Switch to root with login shell
su -
Switch to alice with her environment
su - alice
Run single command as root
su -c 'systemctl restart nginx' root

Common options

FlagDescription
-Login shell — load target user's environment
-cExecute a single command
-sSpecify shell

About su

The `su` command switch user identity — run a shell as another user. User management commands handle creation, modification, and deletion of user accounts and groups.

Multi-user access control is a core feature of Linux. These commands are essential for system administrators managing servers, enforcing security policies, and provisioning access for teams.

The command accepts 3 commonly used flags shown above, though the full set of options is available in the man page (`man su`). The 3 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More User Management Commands

Other commands in the User Management category

Related tools