第一句子网 - 唯美句子、句子迷、好句子大全
第一句子网 > xxx is not in the sudoers file.This incident will be reported.的解决办法

xxx is not in the sudoers file.This incident will be reported.的解决办法

时间:2024-05-01 22:13:47

相关推荐

xxx is not in the sudoers file.This incident will be reported.的解决办法

1.切换到 root 用户下

su root

2.添加sudo文件的写权限

chmod u+w /etc/sudoers

3.编辑sudoers文件

vi /etc/sudoers

找到root ALL=(ALL) ALL,在下面添加usernameALL=(ALL) ALL

在sudoers中可以添加下面任意一条记录youuserALL=(ALL) ALL%youuserALL=(ALL) ALLyouuserALL=(ALL) NOPASSWD: ALL%youuserALL=(ALL) NOPASSWD: ALL第一行:允许用户youuser执行sudo命令(需要输入密码)第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码)第三行:允许用户youuser执行sudo命令,不需要输入密码第四行:允许用户组youuser里面的用户执行sudo命令(需要输入密码)

4.撤销sudoers文件写权限,命令:

chmod u-w /etc/sudoers

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。