用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 为用户名
保存即可。
posted @ 2017-09-03 17:01  flanker_X  阅读(232)  评论(0编辑  收藏  举报