Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
4  
Please consider marking some of the answers to your questions as accepted. –  Dennis Williamson Feb 17 '11 at 5:45
    
agreed. 7 questions and none accepted. –  Michael Dillon Feb 17 '11 at 6:00

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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