When I access the network server, I use the command sudo su to get admin privileges. Recently I found that sudo bash is the correct command and will allow me privileges those su does not.

What is the difference between sudo su and sudo bash? I thought both were equivalent.


When you do sudo su you start the default shell of the root user which is likely to be the Bourne shell (sh). You can do sudo -s to get the default shell of the current user.


What privileges do you miss after

sudo su

? It could be that you simply don't have the root's environment set up after this command. If you do

sudo su -

(note the "-"), then the profile of the root user will be read and the environment (among other things PATH variable) will be set as if you have logged in as root. If you run sudo su, you keep your environment and get the effective uid of 0, meaning you have the privileges of root user without having root environment set up. sudo su - changes your current directory to the root's home directory, so I use sudo su if I want to execute a couple of commands in the current dir (e.g. change owner of a file) without having to type in long paths.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.