What is the difference between commands sudo -i and sudo su -?
Are they the same? They may provide functionally close to the
same thing, but it seems 'sudo -i' is lighter weight and keeps
some handy back references in your environment. You can see the
extra processes by looking at 'ps auxf' (f gives you a forest
view) sudo -i yields this process tree sudo su - yields this
process tree Note that they are starting from the same bash
process pid, 4482, but that su - seems to spawn another step.)
Your first 'sudo' is already elevating your access level to
root. Running su without specifying a username inside sudo
changes the current user to root twice. Another way to
investigate this is by running both commands with strace -f. If
you diff those two straces, you'll see more exeve's being run
for sudo su -. One more thing. sudo -i maintains the extra
environment variables set by SUDO. sudo su - clobbers those
variables. Shot answer: No, they are not the same. Long answer:
sudo and su - are different programs that a