用sudo时提示"xxx is not in the sudoers file. This incident will be reported.

现象:

非Root用户在使用sudo命令时,提示:"xxx is not in the sudoers file. This incident will be reported.(xxx为用户名)

解决办法:

使用

su – root 

切换到root用户,编辑sudoers文件

vim /etc/sudoers
找到“root ALL=(ALL)”在此行下面添加一行
"xxx ALL=(ALL) ALL"
//xxx 为用户名
保存即可。
当你觉得自己的想法很创新时,十有八九是知识面太窄。
原文地址:https://www.cnblogs.com/flankershen/p/7470003.html