Re:Su VS sudo su VS sudo -u -i
by lubutu on Saturday March 24, 2012 @03:06PM
(#3750361)
su is unnecessary; sudo -s is equivalent to sudo su, but allows the admin to restrict who may sudo to whom, for which programs, and so on.
[ Parent
| on HN ]
They are not equivalent. `sudo su` changes the values of USER, HOME, and SHELL to that of the root user. `sudo -s` only changes USER (it seems), but HOME is retained as the SUDO_USER's home directory.
Neither invocation changes the working directory, which is convenient.
Whether sudo sets $HOME depends on your /etc/sudoers configuration. Alternatively, sudo -Hs.