This article describes how to solve the problem of is not in the sudoers file during Ubuntu usage.
When sudo is used, the system prompts "xxx is not in the sudoers file. this incident will be reported. XXX is your user name, that is, your user name does not have permission to use sudo. You just need to modify the/etc/sudoers file.
Example:
The solution is as follows:
1) enter the superuser mode. That is, enter "su-". The system will ask you to enter the superuser password and enter the password to enter the superuser mode. (Of course, you can also use root)
(Note that there is-, which is different from su. When "su" is used, the system only switches to root, but does not pass the root environment variable, or the current user's environment variable. Use the "su-" command to bring the environment variable together, just like root login)
2) Add the write permission for the file. That is, enter the command "chmod u + w/etc/sudoers ".
3) edit the/etc/sudoers file. That is, enter the command "gedit/etc/sudoers" to enter the editing mode and find this line: "root ALL = (ALL) ALL "add" www_linuxidc_com ALL = (ALL) ALL "(here xxx is your user name) under" start ", save and exit.
4) revoke the write permission of a file. That is, enter the command "chmod u-w/etc/sudoers ".