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

6

15

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 ?

Hsu answered 19/11, 2013 at 14:45 Comment(1)
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.Inutility
H
11

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

enter image description here

Hyacinthe answered 19/11, 2013 at 15:17 Comment(1)
2022: Using "First aid" worked for meApostasy
A
16

Finder → Go → Go to folder:

and enter /etc/sudoers and push Go button.

Right click on the sudoers and change ther permission.

Apennines answered 17/11, 2015 at 11:1 Comment(1)
The following file permissions worked for me: System: Read & Write Wheel: Read Only Everyone: Read OnlyGenesisgenet
H
11

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

enter image description here

Hyacinthe answered 19/11, 2013 at 15:17 Comment(1)
2022: Using "First aid" worked for meApostasy
R
8

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

Reasonless answered 29/3, 2018 at 5:17 Comment(1)
Great trick; thanks!Digged
G
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!

General answered 9/1, 2019 at 11:21 Comment(0)
S
1

Just use these commands below under any terminal will do:

  1. $ su

  2. $ chmod 440 /etc/sudoers

Sailplane answered 8/6, 2016 at 6:26 Comment(0)
A
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.

Apostasy answered 28/5, 2022 at 13:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.