In Mac OS X 10.6, how do I give myself permanent sudo privleges? is it like linux, in the "/etc/sudoers" file?

link|improve this question

67% accept rate
You know that sudo is there for a reason, right? The idea is to give access to superuser privileges without being constantly logged in as root (not a good idea). – blahdiblah Jun 6 '11 at 21:26
feedback

3 Answers

up vote 2 down vote accepted

Not exactly experienced in OSX, but it seems to be located in either one of the following:

  • /etc/sudoers
  • /private/etc/sudoers

It is recommended that you use visudo to edit the file but you can use another text editor.

Under the line that says root ALL=(ALL) ALL

You add the name of the user and user ALL=(ALL) ALLto give yourself permanent sudo privileges.

link|improve this answer
1  
ls -ld /etc results in lrwxr-xr-x@ 1 root wheel 11 30 Jun 2010 /etc -> private/etc, so they're both the same file. – Daniel Beck Jun 6 '11 at 21:22
yea, I did it in fedora a while ago.. It seems to be the same process, but thanks.. didn't wanna just go haphazardly changing important system file :D – FALL3N Jun 15 '11 at 0:40
feedback

You can, of course, edit /etc/sudoers manually to accomplish this.

But Mac OS X's System Preferences has a method built-in to achieve the same thing: Give the user an Administrator account, instead of a Standard account, and it will be added to /etc/sudoers as sudoer automatically (via the wheel group membership).

Users will still need to enter their own password though, which is a good thing (tm).

link|improve this answer
Yeah, I've done that in fedora, but I wanted to ask before I did it, so I didn't break anything.. thanks – FALL3N Jun 15 '11 at 0:38
feedback

sudo in OSX is exactly like that under Linux, and like Linux man sudo shows the details

sudo determines who is an authorized user by consulting the file /private/etc//sudoers.

/etc is a symbolic link to /private/etc so your suggestion of /etc/sudoers will work.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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