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 ?
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 ?
Open Disk Utility, select you disk and click "Repair Disk Permissions"
Finder → Go → Go to folder:
and enter /etc/sudoers
and push Go
button.
Right click on the sudoers
and change ther permission.
Open Disk Utility, select you disk and click "Repair Disk Permissions"
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:
$ su
$ chmod 440 /etc/sudoers
© 2022 - 2024 — McMap. All rights reserved.
ls -al /etc/sudoers;id
and give us the output? You may need to doman 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