Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

seanymega

macrumors newbie
Original poster
Feb 14, 2012
12
0
Hi all,

I have been having problems with SUDO on my computer and I know a lot of you have seen these types of errors before and that you all have tried to help others, as I have been reading the other posts -- especially this one https://forums.macrumors.com/threads/447812/. The problem is none of them are working :( This is the error I get;

Sean is not in the sudoers file. This incident will be reported.

This is what I do when I use the command id

uid=502(Sean) gid=20(staff) groups=20(staff),402(com.apple.sharepoint.group.1),401(com.apple.access_screensharing),12(everyone),33(_appstore),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),100(_lpoperator),204(_developer)

I tried to create a new admin account but still the same error...

admin is not in the sudoers file. This incident will be reported.

So I tried the following;

-bash-3.2$ ls -lad /private/etc /private
drwxr-xr-x@ 6 root wheel 204 26 Oct 08:10 /private
drwxr-xr-x 107 root wheel 3638 14 Feb 19:19 /private/etc

-bash-3.2$ ls -la /usr/bin/sudo
-r-s--x--x 1 root wheel 327920 26 Oct 08:05 /usr/bin/sudo


When I saw wheel I thought that this command could help;

sudo dscl . -append /Groups/wheel GroupMembership Sean

but realised I can't actually create a new admin account with sudo capabilities so I feel absolutely screwed :/

Please can someone help me?

Sean
 
Yeah, it said it could not find the chmod 1775...

If you tried to chmod 1775, then it's not going to work. The chmod command changes permissions, which are indicated by a three digit number. You're trying to change the permissions to 775, not 1775. Make sure you type everything exactly correct, it should work.

jW
 
If you tried to chmod 1775, then it's not going to work. The chmod command changes permissions, which are indicated by a three digit number. You're trying to change the permissions to 775, not 1775. Make sure you type everything exactly correct, it should work.

jW

Chmod 1775 is intended to turn on the sticky bit for / so that new folders created in / cannot easily be deleted by mistake.

chmod -t clears the sticky bit.

Mac OS X (Leopard) The ISVTX (the sticky bit) has no effect on executable files. All optimization on whether text images remain resident in memory is handled by the kernel's virtual memory system. A directory whose 'sticky bit' is set becomes an append-only directory, or, more accurately, a directory in which the deletion of files is restricted. A file in a sticky directory may only be removed or renamed by a user if the user has write permission for the directory and the user is the owner of the file, the owner of the directory, or the super-user. This feature is usefully applied to directories such as /tmp which must be publicly writable but should deny users the license to arbitrarily delete or rename each others' files. Any user may create a sticky directory.
 
Last edited:
Chmod 1775 is intended to turn on the sticky bit for / so that new folders created in / cannot easily be deleted by mistake.

chmod -t clears the sticky bit.

Ok so I tried to use the chmod 775 and everything seemed to be flowing through nicely but then when I booted up nothing had changed, I still get the same errors.

With the chmod -t, shall I try using this? How do I use it? Do I do type the following in single user mode? (by the way, I am actually using Lion)

/sbin/fsck -fy
/sbin/mount -wu /
/bin/chmod -t /
/bin/chmod 1775 /
/bin/sync
exit
 
Last edited:
Fixed it!

Hi Guys,

thanks for the help, I did however find out how to fix it -- after much frustration :) I wanted to post it here for other people incase they had this issue.

Basically I went into the root user (system admin) and found out that not even the root was in the sudo list! Crazy yes but it's true. So I deleted all accounts except for my user account and then from the root user in terminal I used typed;

echo 'sean ALL=(ALL) ALL' >> /etc/sudoers

and then;

echo 'root ALL=(ALL) ALL' >> /etc/sudoers

This fixed everything and now even when I create new admin users they have full sudo access.
 
For future reference, make sure to use visudo when editing the sudoers file. Glad your problem is solved!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.