How Do I Switch Users in Ubuntu Terminal?
Contents to Switch to the Root User on Ubuntu-Based Distributions, Enter Sudo Su in the Command Terminal. If You Set a Root Password When You Installed the...
To switch to the root user on Ubuntu-based distributions, enter sudo su in the command terminal. If you set a root password when you installed the distribution, enter su. To switch to another user and adopt their environment, enter su – followed by the name of the user (for example, su – ted).
How do I login as a different user in Ubuntu?
To change to a different user and create a session as if the other user had logged in from a command prompt, type “su -” followed by a space and the target user’s username. Type the target user’s password when prompted.
How do I sudo to another user?
To run a command as the root user, use sudo command . You can specify a user with -u , for example sudo -u root command is the same as sudo command . However, if you want to run a command as another user, you need to specify that with -u .
…
Using sudo.
| Commands | Meaning |
|---|---|
| sudo -u user -s | Start a shell as user. |