发布于2022年11月4日2年前 Centos7 出现xxx不在sudoers文件中的解决方案 http://www.52bug.cn/content/uploadfile/202003/cdc61583776541.jpg今天在搭完一个新的虚拟机后,在使用sudo yum -y update 的情况下,出现了提示:xxx不在sudoers文件中的解决方案,此事将被报告然后一通查找,找到了解决方法,现在记录下来,方便以后查看。su root #切换到管理员模式vim /etc/sudoers #用vim打开sudoers文件#在最后的有效语句后加上下面这句xxx ALL=(root) ALL, !/usr/bin/passwd [A-Za-z]*, !/usr/bin/passwd root #xxx是你的用户名搞定!PS:简单的解决方式su root #进入超级用户模式usermod -a -G wheel username #将username加入wheel分组
创建帐户或登录后发表意见