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

用户使用sudo su指令,输入密码后,报错

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

该用户(记为aaa)和另一个用户bbb权限相同,用户组都都是各自的用户名,但是bbb可以执行sudo,aaa不行。

查看/etc/sudoers文件,包含了如下内容

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "@include" directives:

@includedir /etc/sudoers.d

既没有包含bbb,也没有包含aaa,应该是root ALL=(ALL:ALL) ALL给了用户权限,但是aaa却不行。

进入/etc/sudoers.d/目录下,有文件aaa和bbb,查看bbb文件,发现内容为

bbb ALL=(ALL) ALL

但是查看aaa文件,发现是

ccc ALL=(ALL) ALL

也即,文件里的用户名和实际用户名不一致,改为aaa,恢复正常。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值