I don't think sudo bash
is wrong, it's just less convenient. For one, it's 2 more characters than sudo -i
. With sudo bash
you're just starting bash
as another user (try doing it and doing pwd
to see what the current directory is), whereas sudo -i
"attempts to change to that user's home directory before running the shell". sudo -i
tries to give you an "environment similar to the one a user would receive at login". Also, sudo -i
will read "login-specific resource files such as .profile or .login". Finally, sudo -i
will honor the shell the user set in /etc/passwd
.
On a single-user system these aren't likely to matter too much, but unless you never expect to work on a system other than yours, you'd do well to train yourself to do things the recommended way.
sudo su
is also possibly not entirely wrong (and isn't longer than sudo -i
), but this option is plainly ugly and looks really kludgy; if you can sudo
, why sudo su
, instead of sudo
ing a proper shell? also, sudo su
will not properly set the user's login environment, you need sudo su -
for that, at which point you're again typing 2 more characters than sudo -i
.