It is really simple to switch users in Ubuntu or any other Linux distribution using the terminal.
All you need to do is to know the unsername and its account password and you can switch users with su command.
Youll be asked to enter the password of the user you want to switch to.
As you can see in the screenshot above I changed to user prakash from user abhishek in the terminal.
There are some minor details with this method that Ill share with you in a moment. Ill also share the graphical way of switching users in Linux if you are using desktop Linux.
Switching to root user.
If you want to switch to the root user in Ubuntu you can use the following commandsudo suYoull have to enter your own user password here.
Lets see things a bit in detail. To switch users you need to first know the exact username because tab competition doesnt work here. You can list all the users in Linux command line by viewing the content of the etcpasswd file.