准备把OS的root禁用了,所以其他用户要执行使用root执行的操作时,需要使用sudo。

在没有配置sudo的时候,执行sudo会出现类似以下的报错:

[oracle@test ~]$ sudo /u01/app/oracle/product/11。1/db_1/root。sh
Password:
oracle is not in the sudoers file。 This incident will be reported。

解决办法:

1.切换到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)                ALL
youuser            ALL=(ALL)                NOPASSWD: ALL
%youuser           ALL=(ALL)                NOPASSWD: ALL

第一行:允许用户youuser执行sudo命令(需要输入密码)。
第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码)。
第三行:允许用户youuser执行sudo命令,并且在执行的时候不输入密码。
第四行:允许用户组youuser里面的用户执行sudo命令,并且在执行的时候不输入密码。

4.撤销sudoers文件写权限:
chmod u-w /etc/sudoers

如果不撤销会报错:

[oracle@test ~]$ sudo /u01/app/oracle/product/11.1/db_1/root.sh
sudo: /etc/sudoers is mode 0640, should be 0440

这样非root用户就可以使用sudo了

oracle 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解决

    参考:https://blog.csdn.net/lichangzai/article/details/39501025 如果执行sudo命令的用户没有执行sudo的权限,执行sudo命令时会报下面的 ...

  2. centos添加和删除用户及 xxx is not in the sudoers file.This incident will be reported.的解决方法

    修改主机名:vim /etc/sysconfig/network 1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 # ...

  3. XXX 用户 is not in the sudoers file. This incident will be reported 的问题解决方案

    说的是,这种问题,是出现在ubuntu系统里. root@SparkSingleNode:/usr/local/jdk# pwd /usr/local/jdk root@SparkSingleNode ...

  4. Linux中添加管理员权限问题:xxx is not in the sudoers file. This incident will be reported.

    在各个不同版本的linux中添加拥有管理员权限账户有不同的简便方式. 问题: 今天遇见将新添用户添加到root用户组后,运行sudo仍然提示 ”xxx is not in the sudoers fi ...

  5. XXXX is not in the sudoers file. This incident will be reported解决方法

    假设你用的是Red Hat系列(包括Fedora和CentOS)的Linux系统.当你执行sudo命令时可能会提示“某某用户 is not in the sudoers file.  This inc ...

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

    Description: [sunzl@localhost nuc900bsp$] ./install.sh sorry!you are not the root !! [sunzl@localhos ...

  7. Linux遇到的问题(一)Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法

    提示错误信息 www@iZ236j3sofdZ:~$ ifconfig Command 'ifconfig' is available in '/sbin/ifconfig' The command ...

  8. XXX is not in the sudoers file. This incident will be reported 的问题解决方案

    不多说,直接上干货! 说的是,这种问题,是出现在ubuntu系统里. root@SparkSingleNode:/usr/local/jdk# pwd /usr/local/jdk root@Spar ...

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

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

随机推荐

  1. 12月4日PHPCMS模板

    cms的样式有很多种,我们学习的是phpcms,这些cms都是大同小异,学会了一种就可以使用其它的cms. PHPCMS是一款网站管理软件.该软件采用模块化开发,支持多种分类方式,使用它可方便实现个性 ...

  2. 利用JS判断是否手机或pad访问

    <script type="text/javascript"> /* * 智能机浏览器版本信息: * */ var browser={ versions:functio ...

  3. ECSHOP 商品字段增加新字段的方法

    结合ecshop后台“商品编辑”.“商品录入”来谈谈如何给ecshop商品增加一个新字段,假设我们将这个新字段命名为 new_add 1.首先要修改数据表结构,给表 ecs_goods 增加新字段:n ...

  4. 转载:MySQL 语句大全:创建、授权、查询、修改等

    本文转载>这里 一.用户创建.权限.删除 1.连接MySql操作 连接:mysql -h 主机地址 -u 用户名 -p 用户密码 (注:u与root可以不用加空格,其它也一样)断开:exit ( ...

  5. spring统一日志管理,切面(@Aspect),注解式日志管理

    step1 开启切面编程 <!-- 开启切面编程(通过配置织入@Aspectj切面 ) --> <aop:aspectj-autoproxy/> <aop:aspectj ...

  6. input输入时光标位置靠上问题解决

    在css中如果我们定义了input高度在输入时会发现光标位置靠上了不在居中了,在Chrome浏览器中,当设置了line-height时,input无文字,光标高度与line-height一致:inpu ...

  7. 关于C#中的 static

    一:感受 做商业项目才能更深刻和彻底的探索到技术的原理与真实面貌.以前在学校里面的时候这些C Sharp的基本语法,数据结构,面向对象背的滚瓜乱熟,那真得是背的!无论是从概念从理论上面来谈还是写一个小 ...

  8. Facebook的Web开发三板斧:React.js、Relay和GraphQL

    2015-02-26 孙镜涛  InfoQ Eric Florenzano最近在自己的博客上发表了一篇题为<Facebook教我们如何构建网站>的文章,他认为软件开发有些时候需要比较大的跨 ...

  9. html 标签

    CSS : overflow : hidden   --  就是给一个盒子定义了一个显示范围.内部的物体.只有在这个范围内部才会被显示.不然就被隐藏. overflow-x overflow-y 控制 ...

  10. 《PHP数组函数》笔记

    ① in_array() 检查数组中是否存在某个值;有两个参数,第一个参数是要查找的值,第二个参数是数组名,返回值为布尔,找到则ture否则false; ② array_search 在数组中搜索给定 ...