xxxx is not in the sudoers file. This incident will be reported. 解决方法
使用sudo
命令时出现xxxx is not in the sudoers file. This incident will be reported.这里的xxxx是你的用户名;出现这个提示通常是用户名没有写入到sudoers文件中;
![username is not in the sudoers file](https://static.perfcode.com/uploads/2022/04/11/268708c1a29dee4cdf4efe7774bab3eb.png)
解决方法
先使用su
命令切换到 root 用户:
su
然后编辑/etc/sudoers
,按下图添加一行文本:
![username is not in the sudoers file](https://static.perfcode.com/uploads/2022/04/11/dcd8dd1a4a26d0966d5b74669246a512.png)
注意这里的h0cn
应该替换成你的用户名;
如果使用的是vim编辑器,请使用qw!
保存并退出。