原因

在装系统或者买服务器的时候没有将admin账号加入用户组,使用sudo命令的时候,出现这个情况:

admin 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,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)

ps:这里说下你可以sudoers添加下面四行中任意一条

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

第一行:允许用户youuser执行sudo命令(需要输入密码).

第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码).

第三行:允许用户youuser执行sudo命令,并且在执行的时候不输入密码.

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

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

chmod u-w /etc/sudoers

这样普通用户就可以使用sudo了.

admin is not in the sudoers file. This incident will be reported相关推荐

  1. Linux中新建用户用不了sudo命令问题:rootr is not in the sudoers file.This incident will be reported解决

    Linux中新建用户用不了sudo命令问题:rootr is not in the sudoers file.This incident will be reported解决 参考:https://b ...

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

    xxx is not in the sudoers file.This incident will be reported.的解决方法 参考文章: (1)xxx is not in the sudoe ...

  3. How to Fix “Username is not in the sudoers file. This incident will be reported” in Ubuntu

    How to Fix "Username is not in the sudoers file. This incident will be reported" in Ubuntu ...

  4. [已解决]user is not in the sudoers file. This incident will be reported.(简单不容易出错的方式)

    linux Ubuntu中报错,XXX is not in the sudoers file. This incident will be reported. 今天在学习的时候,不小心把自己的用户su ...

  5. Centos普通用户权限报错:** is not in the sudoers file. This incident will be reported.

    在centos下有一个普通用户hadoop,在用hadoop创建文件夹: [hadoop@localhost /] sudo mkdir /soft [sudo] password for hadoo ...

  6. 解决xx is not in the sudoers file. This incident will be reported.问题

    问题.  xxx is not in the sudoers file. This incident will be reported.(当想要以 xxx的身份切换到root权限时,使用sudo su ...

  7. Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法

    Ubuntu下普通用户用sudo执行命令时报"xxx is not in the sudoers file.This incident will be reported"错误,解决 ...

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

    问题描述: 新建用户执行命令sudo chmod 700 ,提示输入root命令. 输入三次错误. 提示 yourid is not in the sudoers file. This inciden ...

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

    sudo,用其他用户的身份执行命令. 运行该命令时,系统首先检查/etc/sudoers,判断该用户是否有执行sudo的权限,在确定有执行权限后,要求输入自己的密码(当前用户),如果密码正确,会以ro ...

  10. hadoop is not in the sudoers file. This incident will be reported.问题解决

    Ubuntu下普通用户用sudo执行命令时报"xxx is not in the sudoers file.This incident will be reported"错误,解决 ...

最新文章

  1. 135. 分发糖果(贪心算法)
  2. JS实现点击左边标题栏,右边显示对应信息
  3. import caffe ImportError: No module named 'skimage'
  4. 使用PHP管理SQL
  5. bcp+Sql语句抽取数据导出
  6. linux lsattr命令: 显示文件属性
  7. Adobe Flash Player 10 插件无法注册
  8. java取得泛型,Java取得泛型类型
  9. 统一沟通-技巧-9-Lync 2010-Outlook 2010-自动配置-1-IT人员
  10. 日志收集系统Elasticsearch,Fluentd , Kibana
  11. 比特币网站Flexcoin遭黑客攻击 损失极大 被迫关闭
  12. 理解委托的两类必要方法
  13. 【资源分享】一款bootstrap开发的后台管理系统前端模板
  14. Windows无法启动MapGIS DataStorage Service服务
  15. 天正建筑(TArch)8.0破解版下载(包含SP1、全系列注册机)
  16. 力扣539题 最小时间差
  17. javaweb医院科室管理系统springboot
  18. 跟着官方文档一步一步搭建基于gozero的微服务
  19. 门多萨与马尔克斯谈话录
  20. OneDrive教育版注册和登录

热门文章

  1. CentOS7上实现Squid缓存服务器的两种模式
  2. 企业从信息化角度解读智慧城市,难以根治城市病
  3. Ruby Tip:定义索引操作符
  4. ubuntu下安装mysql及卸载mysql方法
  5. mvc:annotation-driven /注解意义
  6. Mysql删除数据报外键约束解决方法
  7. PHPCMS2008调用Uchome系统[空间之星]GET语句
  8. 解析分级存储管理(HSM)
  9. ssl证书不可信 群晖_上海云盾 CDN 网站 SSL 证书过期更新不生效问题排查和解决...
  10. 学计算机的感想300字,大学生计算机实训心得体会3篇