This article was reviewed by Luigi Oppido and by wikiHow staff writer, Nicole Levine, MFA. Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years.
This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 8,261 times.
The "su" command, which stands for "switch user" or "substitute user," makes it easy to change to another user in Linux. Or, if you just want to execute a command as another user without logging in as them, you can use "sudo," or "superuser do." Read on to learn how.
Things You Should Know
- To become another user in Linux, use su - <username>.
- To run commands as a different user, use sudo -u <username> <command>.
- In the GNOME desktop environment, you can change users in the System menu > Power Off / Log Out > Switch User.
Steps
-
Click the system menu. It's at the top-right corner of your desktop—where you'll see the network icon, volume, and battery.
-
Click Power Off / Log Out. This expands more options.
-
Click Switch User and enter that user's login information. As long as you have at least one more user added to your Linux system, you'll see the Switch User option.[3]
- When you switch users, the applications you were running will continue to run in the background.
- You can easily switch back and forth between users as needed.
Expert Q&A
Tips
-
Run the whoami command to see which user you're logged in as.
- If you use su to switch to another user, whoami will report the username you changed to.
- If you used sudo to run a command as another user, you'll still see your regular login name with whoami.
Thanks