Sudo Problems-El Capitan - UID 503, should be 0

Discussion in 'OS X El Capitan (10.11)' started by Mr.B1ack, Mar 1, 2016.

  1. Mr.B1ack macrumors newbie

    Joined:
    Feb 27, 2016
    #1
    Hello,

    this is my first post and I was hoping to get some help with a problem. Whenever I try and use the Sudo command I get the following error message:

    sudo: /etc/sudoers is owned by uid 503, should be 0
    sudo: no valid sudoers sources found, quitting

    I have tried logging into single user mode and typing in the following commands:

    mount -uw

    chown /private/etc/sudoers 0

    After typing in the chown ownership line, I get an error message saying “illegal username”.

    Different things I have tried:
    - Reinstalling the os (El Capitan)
    - Disabling System Integrity Protection (SIP).
    - Calling Apple Care who say that Sudo commands have been disabled in El Capitan.

    FYI

    When I run ls -la /private/etc/sudoers in Terminal, I get the following:


    -rw-r-----@ 1 MY-ADMIN-USERNAME staff 67 18 Feb 14:03 /private/etc/sudoers


    Note I’ve replaced my actual admin username with “MY-ADMIN-USERNAME” just so you know what’s showing.

    I need Sudo commands to work for a range of reasons, one of which is to get CrashPlan to work.

    Any advice would be greatly appreciated.
     
  2. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #2
    chown expects the username first instead of the file.
    Code:
    chown root:wheel /private/etc/sudoers
    This is a serious problem though and you really should look into how this happened in the first place. Consider doing a full system install via the App Store (basically like you were upgrading from an older system to El Capitan). If that does not work, consider a system wipe and restore with Migration Assistant.
     
  3. Mr.B1ack, Mar 1, 2016
    Last edited: Mar 1, 2016

    Mr.B1ack thread starter macrumors newbie

    Joined:
    Feb 27, 2016
    #3
    Thanks for your suggestions KALLT.

    When I type in the code you suggested, I get the message "Operation not permitted".

    Regarding your other suggestions, reinstalling El Capitan via the app store AND doing a system wipe and restore with Migration Assistant are amongst the things I've tried. They didn't work unfortunately.

    Bizarrely, the Apple care person I spoke to today claims that El Capitan disables Sudo commands. That sounds wrong. I'm pretty sure I was able to use it in El Capitan the first time I installed it (I've done a number of wipe and reinstalls for various reasons).
     
  4. KALLT, Mar 1, 2016
    Last edited: Mar 1, 2016

    KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #4
    Are you using the chmod command from the same user account that owns the sudoers file? You can also enter single-user mode by holding down command-S upon boot (do not use the mount command for this). Alternatively, try changing it from Recovery by navigating to your Macintosh volume with the cd command and then trying it from there.

    What kind of hardware setup do you have? Have you made any changes to your hard drive? In Disk Utility, can you check whether the parameter ‘Owners enabled’ of your Macintosh HD is set to ‘yes’?
     
  5. Mr.B1ack thread starter macrumors newbie

    Joined:
    Feb 27, 2016
    #5
    I've done it in my standard account, admin account, root account and single user mode. In the Standard and Admin, it gives the "Operation not permitted" error message. In Single User Mode it gives the error message "Read-only File System".


    Imac 2010, 3.2GHZ, 16GB RAM, 500GB SSD - The SSD was installed about a year ago. Under Disk Utility, the "Owners" parameter shows as "Enabled".
     

Share This Page