Sudo issue, seen other posts but nothing works

Discussion in 'macOS' started by seanymega, Feb 14, 2012.

  1. seanymega macrumors newbie

    Joined:
    Feb 14, 2012
    #1
    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 http://forums.macrumors.com/showthread.php?t=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
     
  2. nDarkness macrumors newbie

    Joined:
    Jan 10, 2012
    #2
    Did the single user mode suggestion by DVD not work for you?
     
  3. seanymega, Feb 14, 2012
    Last edited: Feb 14, 2012

    seanymega thread starter macrumors newbie

    Joined:
    Feb 14, 2012
    #3
    Yeah, it said it could not find the chmod 1775...
     
  4. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #4
    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
     
  5. r0k, Feb 14, 2012
    Last edited: Feb 14, 2012

    r0k macrumors 68040

    r0k

    Joined:
    Mar 3, 2008
    Location:
    Detroit
    #5
    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.

     
  6. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #6
    Huh. Learn something new every day. Thanks.

    jW
     
  7. seanymega, Feb 14, 2012
    Last edited: Feb 15, 2012

    seanymega thread starter macrumors newbie

    Joined:
    Feb 14, 2012
    #7
    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
     
  8. seanymega thread starter macrumors newbie

    Joined:
    Feb 14, 2012
    #8
    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.
     
  9. nDarkness macrumors newbie

    Joined:
    Jan 10, 2012
    #9
    For future reference, make sure to use visudo when editing the sudoers file. Glad your problem is solved!
     

Share This Page