Mac OS X El Capitain can't sudo

1

Getting this error when trying to sudo on a mac I just received from work.

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

I tried disabling system integrity protection as recommended here: https://stackoverflow.com/questions/36264655/lost-permission-for-sudo-in-osx-el-captain.

I also enabled the root account so I could su to the root account to fix the problem. (https://support.apple.com/en-us/HT204012)

But I'm still getting the error. (which really surprised me).

I checked the permission on the /private/etc/sudoers file and on /etc and on /private and on /private/etc they look fine (755).

ClintM

Posted 2016-06-22T13:21:47.010

Reputation: 207

Answers

0

The permissions on the root dir (/) were wrong! After I su to root I set the permission on / with:

chmod a+x /

And now I can run sudo.

ClintM

Posted 2016-06-22T13:21:47.010

Reputation: 207