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 up your finder and go to /etc . In here, you can view the details of the sudoers file, including permissions - screenshot below. Change the permissions for "everyone" here to Read & Write. At this time, you can edit yourself back into the file with any text editor.
The Sudoers file is located at / etc / sudoers, but unlike / etc / hosts and many other system configuration files, you do not want to point to a generic text editor to edit the file. Instead, you want to use a specific command called 'visudo' that validates the correct syntax before saving the document.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With