The username is not in the sudoers file, this will be reported

The sudo command allows you to execute commands as root to complete some tasks that our account cannot complete.

In fact, not all users can execute sudo, because the authorized users are in /etc/sudoers.

We can open /etc/sudoers through the editor, or directly use the command visudo to do this.

After opening sudoers, add your own account and save it as follows.

 

# User privilege specification
root    ALL=(ALL:ALL) ALL
linc    ALL=(ALL:ALL) ALL


The permission of sudoers is 0440, which means that only root can read. After you use root or sudo, forcibly save (wq!).

 

sudo:/etc/sudoers can be written by anyone

 

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

solution:

The permissions of sudoers have been changed, just change it back.

pkexec  chmod  0440  /etc/sudoers

Guess you like

Origin blog.csdn.net/whuzhang16/article/details/109509931