Question

Currently, I am working on an OSX Maverick, and I can't use sudo command in Terminal.


My-Mac:~ phucnd$ sudo

sudo: /etc/sudoers is world writable

sudo: no valid sudoers sources found, quitting.

How can i fix it ?

Was it helpful?

Solution 2

Open Disk Utility, select you disk and click "Repair Disk Permissions"

enter image description here

OTHER TIPS

Finder → Go → Go to folder:

and enter /etc/sudoers and push Go button.

Right click on the sudoers and change ther permission.

1.Enable root user:
System Preferences -> Users&Groups -> Login options -> Network Account Server -> Join -> Open Directory Utility -> Edit(menu) -> Enable Root User

2.switch to root,change /etc/sudoers permissions
$su
$chmod 440 /etc/sudoers

Finder -> Go -> Go to folder

and enter /etc/sudoers and push Go button. Right click on the sudoers -> click on get info -> change permission to: System: Read & Write Wheel: Read Only Everyone: Read Only

Lock it and open a terminal and try again.

All the best!

Just use these commands below under any terminal will do:

  1. $ su

  2. $ chmod 440 /etc/sudoers

  1. Open `/etc/ directory: enter image description here
  2. Right click on sudoers > Get Info
  3. Click lock icon
  4. Set permissions as follows:

sudo: /etc/sudoers is world writable 5. Try running sudo ls and see if you get any errors. If you get an error about sudoers.d just delete that folder if its empty.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top