Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I know it is possible to enable root user and then logging in as the root user. But is it possible to get root access with your admin account in OSX Mavericks?

It is kinda annoying to always type the password whenever you are installing stuff and using the terminal.

Last resort would be to always login as the root user?

share|improve this question
    
I logging once into root with sudo -s really to much for you ? –  Matthieu Riegler Mar 16 at 16:46
    
What if you install a lot of software? You have to enter your password every time. Yes, that is too much for me. I bet I'm not the only one with the problem. I might be wrong though. –  WYS Mar 16 at 17:34
2  
That's what sudo -s prevents you to do by creating a shell root session. –  Matthieu Riegler Mar 16 at 20:45

2 Answers 2

sudo asks for the admin password only if you haven't used the command in the last 15 minutes or so. For extended root sessions I usually run sudo -s to create a new shell with root privileges.

share|improve this answer
    
That's a good solution, noted. –  WYS Mar 16 at 16:11
1  
Alternately, you could do sudo -v periodically. That'll reset the timer to 15 minutes (only prompting for your password if it's already expired). You might also edit the sudoers file and raise the time limit (don't raise it too high, though). –  Blacklight Shining Mar 16 at 21:48

Theoretically speaking, you could add your admin account into the wheel group, then use visudo to edit the sudoers file to allow your user account to execute commands as root. Not only would you have root privileges automatically in Terminal, it would also apply to the GUI as well (no more entering passwords when installing packages or unlocking preferences). However, granting root access to any account other than the root user is a Bad Idea and would be the Wrong Thing to do. The security ramifications of doing this are extreme, and could seriously mess up your system if you don't know what you're doing (and even if you do).

But you did want to know if it was possible.

share|improve this answer
1  
That's not how wheel works. Being in group wheel would give you access to gid 0, not uid 0. wheel is generally used on BSD (though not OS X by default) to restrict who can su/sudo to root, but does not automatically confer rights. cf. administratosphere.wordpress.com/2007/07/19/the-wheel-group –  zigg Mar 17 at 0:28
2  
You could always set your account's uid to 0; there's nothing preventing multiple accounts sharing a uid on Unix. That said, this is an absolutely, really, completely, totally, and utterly terrible idea. –  sapi Mar 17 at 3:29
    
@zigg Thanks for the correction--I was thinking of <a href="administratosphere.wordpress.com/2007/07/19/the-wheel-group/… line</a> being changed to allow the specified user to execute commands as root. –  Matt Mar 18 at 21:55
    
On OS X, the admin group actually does have sudo rights without all the wheel etc. You'll have this group membership if your account has the "Allow user to administer this computer" box ticked. cf. /etc/sudoers, which you can't even look at unless you're root or in the wheel group. –  zigg Mar 18 at 22:10

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.