How to switch users in Linux

Linux systems have different types of users with different types. The “su” is the easiest way to switch to the administrative account in the current login session. This is especially handy when the root user is not allowed to log in to the system through ssh or using the GUI display manager.

How to switch users in Linux on the command line using “sudo su”

su, also referred to as substitute user, super user, or switch user, is used by a computer user to execute commands with the privileges of another user account. When executed it invokes a shell without changing the current working directory or the user environment.

root@test-VirtualBox:~# su test

Changing to the root user

test@test-VirtualBox:/$ sudo -i

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x