Ubuntu16.04 of xxx is not the solution in the sudoers file.This incident will be reported. The

Problem: xxx is not in the sudoers file.This incident will be reported.because the average user can not use sudo.

Solving steps:

1, switch to the root user:su root

2, add sudo write access to the file, the command is:chmod u+w /etc/sudoers

3, edit sudoers file:vi /etc/sudoers

Find the line root ALL=(ALL) ALL, add it below xxx ALL=(ALL) ALL(here xxxis your user name)

Under here to say, you can sudoersadd any of the following four lines a:

youuser            ALL=(ALL)                ALL
%youuser           ALL=(ALL)                ALL
youuser            ALL=(ALL)                NOPASSWD: ALL
%youuser           ALL=(ALL)                NOPASSWD: ALL

The first line: allows the user to youuserexecute sudo command (password required).
The second line: allows the user to set youuserinside sudo command performed by the user (password required).
Third row: Allows users to youuserexecute sudo command, and do not enter the password in the course of implementation.
Fourth row: Allows the user group youuserwhich sudo command performed by the user, and do not enter a password at the time of execution.

4, revoke sudoersfile write permissions, the command:chmod u-w /etc/sudoers

So far, the average user can use sudo.

Reference Gangster

Guess you like

Origin www.cnblogs.com/sirxy/p/12110769.html