sudoers issue; not owned by 0

Discussion in 'Mac Basics and Help' started by benny3t3, Feb 26, 2012.

  1. benny3t3 macrumors newbie

    Feb 26, 2012
    sudo: /opt/local/etc/sudoers is owned by uid 503, should be 0

    Hi all, as you can see, I totally screwed up my sudoers file, actually, I did it a looong time ago, but decided to live with it. Now I want it back.

    I know what caused the issue, I overwrote the file in finder and now I can't access the System or Wheel in permissions in GetInfo to repair permissions.
    Well, at least i'm sure that is worth noting.

    Long story short: sudoers is owned by uid 503, should be 0

    :broke sudo (can't remember how, I didn't even program at all back then)
    :edited sudoers without visudo(synax errors)
    :found an original copy of the sudoers file and replaced the text in the sudoers file with that.
    :fixed the resulting issues with permissions using chmod in single user mode.
    :the above error occurs.

    Oh and, if anyone could link me to a tut on XCode(The software), or some pdf or book, I would appreciate it. all of these issues are making C++ much more difficult to use than Java and as3... Is there some sort of central documentation for unix programming?

    I appreciate your help.
  2. Dweez macrumors 65816


    Jun 13, 2011
    Down by the river
    Which version of OSX are you using? Are you using a non-standard version of sudo? My sudoers file lives at /etc/sudoers.

    Do you have the root account enabled?
  3. benny3t3 thread starter macrumors newbie

    Feb 26, 2012
    Well, I have two sudoers files; don't ask me why. One in /etc/sudoers and one in opt/local/etc/sudoers.
    As for having the root account enabled. I am not sure what you mean.
    I am an administrator if you mean that.
  4. maflynn Moderator


    Staff Member

    May 3, 2009
    Log in as root and fix it, that's the easiest way to reset the permission on this file
  5. benny3t3 thread starter macrumors newbie

    Feb 26, 2012
  6. benny3t3 thread starter macrumors newbie

    Feb 26, 2012
    Easy as pie! Just logging in as root and doing:
    visudo /etc/sudoers //open sudoers file with visudo
    SHIFT+://open vi prompt
    qw //quit and save
    hoorah! File owned by 0. Everyone is happy. Thanks maflynn and Dweez.

Share This Page