Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have been doing this for a while:

sudo su -

but it uses 'sh' rather than 'bash', which is what I'd like to do.

Which command will log me in as root and get me a bash shell even if that's not the default the system gives me?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Try this command:

sudo -i bash
share|improve this answer
    
You know it's interesting... your command sounds great if I read the "man page" but it does not go through my .profile (?!), using sudo bash -l does... but it keeps me in /Users/robottinosino rather than /var/root! Hmmm... any ideas? –  Robottinosino Jul 13 '12 at 17:19
    
@Robottinosino How are you determining that .profile is not read? It is read for me, as it should. –  jw013 Jul 13 '12 at 17:31
    
Because .profile has side effects for me, like locking a file somewhere, and these are not triggered. –  Robottinosino Jul 13 '12 at 17:35
    
Just to make sure, this is root's profile you are talking about right? –  jw013 Jul 13 '12 at 17:37
    
$ grep root /etc/passwd (...) root:*:0:0:System Administrator:/var/root:/bin/sh but I learned this convention is not used on OS X? Something else is used instead (read: chsh) –  Robottinosino Jul 13 '12 at 19:08

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.