sudo on different Debian versions

The environment handling behaviour with sudo changed in Debian Squeeze. This table shows the results of running various sudo commands on several different Debian and Debian-derived distros.

Debian LennyDebian SqueezeDebian JessieUbuntu Trusty
$HOMEcwd.profile$HOMEcwd.profile$HOMEcwd.profile $HOMEcwd.profile
sudo -s unchangedunchangednot run/rootunchangednot run/rootunchangednot rununchangedunchangednot run
sudo -i /root/rootroot's/root/rootroot's/root/rootroot's/root/rootroot's
sudo su /rootunchangednot run/rootunchangednot run/rootunchangednot run/rootunchangednot run
sudo su - /root/rootroot's/root/rootroot's/root/rootroot's/root/rootroot's
sudo -s
run invoking user's shell only
sudo -i
produce a more login-like environment, including running root's .profile
sudo su
bare su is similar to sudo -s
sudo su -
similar to sudo -i

[DIR] Back to Projects