Address: http://www.linuxidc.com/Linux/2010-12/30386.htm
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.
1) enter the superuser mode. That is, enter "Su -"
Su-
The system will ask you to enter the superuser password and enter the password to enter the superuser mode. That is, in the root user mode, it is also root for the root user to the password. 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
Go to edit mode and find this line:
Root all = (all) All
Add it below:
Hadoop all = (all) All
Here, hadoop is your user name, and then save and exit.
4) revoke the write permission of a file. That is, enter the command:
Chmod U-W/etc/sudoers