Download Article
Easy ways to change to another user in Linux
Download Article
- Using Su |
- Using Sudo |
- Using GNOME |
- Tips
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] X Research source
- 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.
Advertisement
Expert Q&A
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
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
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement
References
About This Article
Thanks to all authors for creating a page that has been read 5,242 times.
Advertisement