sudo: /etc/sudoers is world writable

Modifying the permissions of /etc/sudoers leads to this error
Solution:
1. Restart the server, press F11, enter the BOOt Menu, select "ubuntu", press Enter, press the up and down keys or esc 2.
insert image description here
Enter the GNU GRUB interface (if you can reboot, Enter directly, you don’t need to execute step 1)
insert image description here
3. Select ubuntu advanced option
4. Select the recovery mode format, press E (do not press Enter, but can be written)
5. Change ro to rw, Ctrl+X to enter the interface as shown below , select root and press Enter to enter the terminal of the root user
insert image description here

6. Enter in the terminal: chmod 0440 /etc/sudoers
and then reboot

Remarks: After restarting, rw will return to ro.
If you forget the root password, you can try root. If it is not set, it may default to this.
Thanks: https://www.codetd.com/article/3725146

Guess you like

Origin blog.csdn.net/weixin_44594953/article/details/125746677