XXX is not in the sudoer file(普通用户不能使用sudo权限)

问题:XXX is not in the sudoer file.This incident will be reported.

解决方法:

        1、su root (su -l) 输入root用户密码

        2、chmod u+w /etc/sudoers

        3、vim /etc/sudoers

             修改地方:在 ROOT ALL=(ALL)ALL 下加一行:XXX ALL=(ALL)  ALL

             保存并退出:按ESC :wq

        4、chmod u-w /etc/sudoers

 su xxx

此时xxx用户使用sudo就不会再出现以上问题了!

如果想给所有的用户使用sudo权限,则: ALL ALL=NOPASSWD: ALL