Use su to assume another user or root on the command line and learn when and why to use it. 08.05.2026 | reading time: 3 min On a Linux system the su command lets a user assume another account, most commonly root, to perform tasks that need higher privileges; this guide shows how to use it, when it changes your environment, and why distributions often favour sudo instead. Become root in two commands Try this hands-on demo to see su in action: ```bash $ su - Password: # whoami root # exit $ su -c 'uptime' Password: 10:23:45 up 5 days, 3:14, 2 users, load average: 0.00, 0.01, 0.05 $ su bob Password: $ whoami bob ``` Behavior and options Use su dash (su - or su -l) to start a login shell and load the target user's environment, or omit the dash to keep the current environment; use su -c 'command' to run a single command as the target user; the -s option chooses a specific shell for the session and runuser offers similar functionality without password prompts for root-invoked scripts. Security posture and practical limits su authenticates as the target user which means to become root you normally need the root password; on many modern distributions root is locked and administrators prefer sudo for per-command privilege delegation and auditing; PAM configuration and wheel/group restrictions can limit who may call su, and using su hands full root shells increases risk compared with limited sudo usage. Nearby commands worth knowing sudo provides fine-grained, auditable privilege elevation; runuser is useful in scripts when already root; pkexec offers GUI-aware privilege elevation via PolicyKit; each tool fits different control and auditing requirements, so pick the one that matches your operational and security needs. Next steps Start practicing on a lab machine: switch to a dedicated test user, experiment with su - versus su, and try su -c for one-off tasks; deepen your knowledge and consider formal certification such as CompTIA Linux+ or LPIC-1, with bitsandbytes.academy being an intensive exam preparation. Join Bits & Bytes Academy First class LINUX exam preparation. utilities security processes scripting infrastructure