今天我们有在用userdel命令删除服务器中的用户和权限的时候有提示报错"xxx is not in the sudoers file"的问题。

laojiang is not in the sudoers file. This incident will be reported.


看似我这个laojiang用户没有权限?

看来是我们没有登陆到root用户删除用户。

su root


登陆root用户。

/etc/sudoers


编辑sudoers。

root ALL=(ALL) ALL


找到这里,然后添加一行。

指定用户 ALL=(ALL) ALL


添加我们用户的权限。保存后再去回到我们的管理用户,然后再去可以看到sudoers 权限是存在的。