s7ven
s7ven

Reputation: 183

"/etc/sudoers is world writable" on Mac OS X Mavericks

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 ?

Upvotes: 15

Views: 23203

Answers (6)

Janac Meena
Janac Meena

Reputation: 3557

  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.

Upvotes: 1

Hardik Mamtora
Hardik Mamtora

Reputation: 1652

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!

Upvotes: 5

Marx Yu
Marx Yu

Reputation: 371

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

Upvotes: 8

Kendrick johnson
Kendrick johnson

Reputation: 322

Finder → Go → Go to folder:

and enter /etc/sudoers and push Go button.

Right click on the sudoers and change ther permission.

Upvotes: 16

kyokose
kyokose

Reputation: 81

Just use these commands below under any terminal will do:

  1. $ su

  2. $ chmod 440 /etc/sudoers

Upvotes: 1

Hoang Viet
Hoang Viet

Reputation: 228

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

enter image description here

Upvotes: 11

Related Questions