14

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 ?

Community
  • 1
  • 1
s7ven
  • 173
  • 1
  • 2
  • 12
  • can you do `ls -al /etc/sudoers;id` and give us the output? You may need to do `man chmod` to learn how to change the permissions on files. If the file isn't owned by you, you may need to find another way to login as root to change the permissions on the file. – user2932397 Nov 19 '13 at 14:47

6 Answers6

14

Finder → Go → Go to folder:

and enter /etc/sudoers and push Go button.

Right click on the sudoers and change ther permission.

Kendrick johnson
  • 302
  • 1
  • 5
  • 12
11

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

enter image description here

Hoang Viet
  • 228
  • 2
  • 4
7

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

Marx Yu
  • 351
  • 5
  • 8
5

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!

Hardik Mamtora
  • 1,642
  • 17
  • 23
1

Just use these commands below under any terminal will do:

  1. $ su

  2. $ chmod 440 /etc/sudoers

kyokose
  • 81
  • 1
  • 9
1
  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.

Janac Meena
  • 3,203
  • 35
  • 32