1

To switch between users sometimes sudo su newuser is used.

What is meaning of sudo su together?

Can anyone tell exactly how they both command together work?

0

2 Answers 2

3
  • You need superuser power to switch users. Hence the sudo
  • su is the command to "switch user" and the name behind it what you switch to, where nothing behind it makes you "root".

  • sudo -i is preferred over sudo su when switching to "root" since log files are then updated with the user login name and not "root".

0

When changing the user with su you need to know the password of the user you are changing to.

Using sudo su - <username> does not require the password of the user you are changing to, but only your own password for sudo. With sudo you effectively run su as root who is allowed to change the user without knowing the password of the user.

Not the answer you're looking for? Browse other questions tagged .