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

Linux 报错: ** is not in the sudoers file. This incident will be reported.

错误原因

顾名思义,该用户没有在 sudoers file 里面.

解决办法

sudoers file 里面添加该用户即可:

1. 切换到管理员用户
su root
2. 修改文件权限
chmod 777 /etc/sudoers
3. 修改 sudoers file
vim /etc/sudoers

在root ALL=(ALL:ALL) ALL 下面添加一行,yourName 就是你的用户名:

yourName   ALL=(ALL)ALL

然后按esc, 输入 :wq 保存退出即可.

4. 改回文件权限
chmod 440 /etc/sudoers
5. 测试成功与否

切换到改用户,执行 sudo 命令,比如:

su yourName
sudo apt install vim

其他

如果报错的话,请看这里: Linux shell报错: * is not allowed to run sudo on *

  • 12
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: 当提示"same01 is not in the sudoers file. This incident will be reported."时,意味着用户same01没有在sudoers文件中被授权使用sudo命令。sudoers文件是用来配置sudo命令的权限的文件。\[1\]在sudoers文件中,可以通过添加用户到特定的用户组或直接指定用户来授权其使用sudo命令。在这个例子中,可以通过编辑sudoers文件并添加"same01 ALL=(ALL) ALL"来授权same01用户使用sudo命令。\[3\]请注意,对sudoers文件的修改需要以管理员身份进行,可以使用"sudo su"命令切换到管理员身份。\[1\] #### 引用[.reference_title] - *1* *2* [Linux系统 sudo su命令报 ...is not in the sudoers file. This incident will be reported.](https://blog.csdn.net/Skirmishing/article/details/124796441)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [xx is not in the sudoers file. This incident will be reported.](https://blog.csdn.net/Cryhelyxx/article/details/43605731)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值