Macox cannot use sudo,/etc/sudoers is world writable

1. Recently, I don"t remember when it is better than the permission problem. When I use sudu today, I find it can"t be used. I keep prompting the following error

.
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

in the next search, I found a lot of articles, most of which were CSDN, but none of them could be solved, and some of them even broke the system.
finally found a solution. The original link: to solve the problem of sudoers permissions on macOS

.

1. We want to open root users:
system preferences-> users and groups-> Login options-> Network account Server-> join-> Open Directory Utility-> unlock-> Top menu bar-> Edit-> enable Root users, set root password
2. Enter

at the terminal
su root 

then execute:

chomd 555 /etc/sudoers
exit

then you can enter the sudo command

Mar.17,2022

chomd 555 / etc/sudoers

this will lead to security risks, which should be changed to 440, and both users and groups are root, as follows

-r--r----- ... root root ...  /etc/sudoers
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e54351-445ec.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e54351-445ec.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?