美文网首页
xxx is not in the sudoers file.T

xxx is not in the sudoers file.T

作者: 爱的旋转体 | 来源:发表于2018-10-16 15:14 被阅读0次

1.切换到root用户;

su

2.添加sudo文件的写权限;

chmod u+w /etc/sudoers

3.编辑sudoers文件;

vi /etc/sudoers

4.根据需要在root ALL=(ALL) ALL下面添加内容;

youuser            ALL=(ALL)                ALL
%youuser           ALL=(ALL)                ALL
youuser            ALL=(ALL)                NOPASSWD: ALL
%youuser           ALL=(ALL)                NOPASSWD: ALL

第一行:允许用户youuser执行sudo命令(需要输入密码).
第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码).
第三行:允许用户youuser执行sudo命令,并且在执行的时候不输入密码.
第四行:允许用户组youuser里面的用户执行sudo命令,并且在执行的时候不输入密码.

5.撤销sudoers文件写权限;

chmod u-w /etc/sudoers

相关文章

网友评论

      本文标题:xxx is not in the sudoers file.T

      本文链接:https://www.haomeiwen.com/subject/lgjhzftx.html