xxx is not in the sudoers file. This incident will be reported
使用sudo的时候,出现提示xxx is not in the sudoers file. This incident will be reported
发现原来是xxx没有sudo权限。解决办法如下:
- 切换到使用root账户
- 添加
/etc/sudoers
文件的写权限。 - 编辑
/etc/sudoers
,找到root ALL=(ALL) ALL
,在后面添加xxx ALL=(ALL) ALL
- 撤销
/etc/sudoers
文件的写权限
这样一来,xxx用户就有sudo权限了💪