AidanBW

Q: sudo: can't open /private/etc/sudoers: Permission denied  |  sudo: no valid sudoers sources found, quitting

Hi,

I've had this problem before on an old machine and managed to fix it quite quickly, but the things I tried before don't seem to be working on this machine.

 

Basically, when I go in to Terminal and try running something with sudo, it just echoes:

sudo: can't open /private/etc/sudoers: Permission denied

sudo: no valid sudoers sources found, quitting

 

I also get the same message when booted in to Single user mode, thinking it might just have been an issue with my users id. I have already tried changing the file permissions, editing the sudoers file to add in my local users record etc...... but then it just gives me a different error message (eventually coming back to the above when I try changing something else to fix it).

 

I've run Applejack and Diskutility, but as expected they don't work either........

 

Any help would be much appreciated!- my new MacBook Pro won't even install anything requiring root permissions any longer, giving the same error message in the /var/log/install.log! :-(

 

As you can understand, I'm very upset because it is a new machine, and I have no idea what would have caused this to happen. The usual cause is editing the sudoers file without using visudo, but I can never recall doing that.

 

I need my root access back!

 

Kind regards,

Aidan

iMac, Mac OS X (10.7.2), Hardware Serial: VM025TDGB9S

Posted on Jan 24, 2012 12:17 PM

Close

Q: sudo: can't open /private/etc/sudoers: Permission denied  |  sudo: no valid sudoers sources found, quitting

  • All replies
  • Helpful answers

first Previous Page 3 of 3
  • by KeithO Ep,

    KeithO Ep KeithO Ep Dec 28, 2015 5:42 AM in response to VikingOSX
    Level 1 (0 points)
    Dec 28, 2015 5:42 AM in response to VikingOSX

    Thanks for your help. What I'm really trying to do is reset  the right permissions in my /etc/ recursively, directories an files. In El Capitan

  • by KeithO Ep,

    KeithO Ep KeithO Ep Dec 28, 2015 6:14 AM in response to BobHarris
    Level 1 (0 points)
    Dec 28, 2015 6:14 AM in response to BobHarris

    How do repair the /etc/ folders permissions to their default?

    Manually would be a killer.

    El Capitan has no repair permisssion.

  • by BobHarris,

    BobHarris BobHarris Dec 28, 2015 6:19 AM in response to KeithO Ep
    Level 6 (19,272 points)
    Mac OS X
    Dec 28, 2015 6:19 AM in response to KeithO Ep

    Is there a command line command in the bash terminal?

    sudo /usr/sbin/diskutil repairPermissions /

    However, I'm not sure it will work unless you are logged in as root or you have sudo working, but if sudo is not working ...

     

    I guess it could be done from single user mode.  Or if you can get sudo working, then the rest can be done as a normal admin user via the 'sudo' command.

  • by roblith,

    roblith roblith Jan 4, 2016 2:17 PM in response to Joshua Brown1
    Level 1 (0 points)
    Jan 4, 2016 2:17 PM in response to Joshua Brown1

    Thanks Joshua Brown1, Finally an answer that actually sorted out my root (shudders) access on my El Capitan 10.11.3 Beta (15D9c) even though this was written in 2013!

     

    Regards,

    Rob

  • by JCGray49,

    JCGray49 JCGray49 Jan 27, 2016 8:19 AM in response to Joshua Brown1
    Level 1 (0 points)
    Jan 27, 2016 8:19 AM in response to Joshua Brown1

    This guy is a true GENIUS......  Joshua's post helped me after hours and hours of Internet research on why I could not get certain *pkg files to install on my relatively new Macbook Pro 15 w/SSD / Yosemite.   Even after trying all the "repair disk permissions" that were suggested I still had problems until I used Joshua's methods.   Thank You Joshua......  You have no idea how much better I feel knowing I as the admin can know install some of the software that I wanted on the Mac side of my Bootcamped Macbook.

    Regards,

    Jeff Gray

  • by valobal,

    valobal valobal Feb 5, 2016 5:25 PM in response to Joshua Brown1
    Level 1 (6 points)
    Feb 5, 2016 5:25 PM in response to Joshua Brown1

    Thanks!!! Joshua Brown1I use your advise on El Capitan and works perfectly, regards!

  • by Tony.Collins,

    Tony.Collins Tony.Collins Mar 13, 2016 8:54 AM in response to VikingOSX
    Level 1 (4 points)
    iPhone
    Mar 13, 2016 8:54 AM in response to VikingOSX

    VikingOSX, I think you've missed every post above you.

     

    If people who have this problem try to use sudo, they will get the error message that everyone has been posting about, "sudo: unable to stat /etc/sudoers: Permission denied".

     

    In these circumstances, sudo simply does not work. So you cant use sudo to edit sudoers with visudo, and you can't su to elevate your privileges to change the necessary permissions to allow you to use sudo.

     

    That is why everyone is trying these more complex solutions - as everyone's been saying, they cant use the normal su/sudo commands.

  • by Tony.Collins,

    Tony.Collins Tony.Collins Mar 13, 2016 9:02 AM in response to Joshua Brown1
    Level 1 (4 points)
    iPhone
    Mar 13, 2016 9:02 AM in response to Joshua Brown1

    Joshua, are you able to help me understand what's going wrong when I try to follow your instructions?

     

    I carried them out, up to logging out and logging in as root. I entered 'root' and the new password - and then the screen went black and I had a mouse cursor pointer.

     

    I could move the mouse around, but even after several minutes of waiting, nothing changed. I had to force the machine to shutd own. I'm on a 2015 MacBook Pro with an SSD, so I wasn't waiting for a hard drive to finish something.

     

    Have you (or anyone else!) got any idea why this is happening? I'm on El Capitan, which might be the reason!

     

    Thanks Joshua/everyone

  • by JockTar,

    JockTar JockTar May 18, 2016 4:58 AM in response to yb11
    Level 1 (4 points)
    May 18, 2016 4:58 AM in response to yb11

    Four years later... struggling with a corrupt Lion installation and it worked for me too!

first Previous Page 3 of 3