What's the magic of the "sudo su"?

sudo allows one user to run commands with the permissions of another user. By default, on most systems, some users are allowed to use sudo to run commands as root. su requires a user's password to log in as that user, unless it is run by root. Thus, sudo su allows you to pretend to be root in order to log in as root without root's password.

PS: sudo -i is recommended over sudo su - which is recommended over sudo su for most everyday purposes.


Look at the file /etc/sudoers. It has been configured to allow your user account to execute su (and perhaps other commands) as root under sudo without needing a password. And when run as root, su does not prompt for authentication.

This can be done either on a per-account basis or by group membership. (Typically, by membership in the wheel group.)


sudo su lets you use the password for demo@PHP_DEV_57 to get a root terminal (as long as you're listed in the sudoers file). su makes you use the password for root@PHP_DEV_57 (which may or may not exist or be known) to get a root terminal.