用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是当前用户名,也就是当前用户没有权限使用sudo,只要修改一下/etc/sudoers文件就行了。修改方法:

1) su -

2)chmod u+w /etc/sudoers
3)vi /etc/sudoers,  找到这一 行:"root ALL=(ALL) ALL" 在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是用户名),保存退出。
4)chmod u-w /etc/sudoers