How to switch users in Linux

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
test@test-VirtualBox:/root$

changing to root user

test@test-VirtualBox:/$ sudo -i

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s