准备把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. 前端Js框架汇总

    概述: 有些日子没有正襟危坐写博客了,互联网飞速发展的时代,技术更新迭代的速度也在加快.看着Java.Js.Swift在各领域心花路放,也是煞是羡慕.寻了寻.net的消息,也是振奋人心,.net co ...

  2. shell正则表达式

    正则表达式 主要用于字符串的模式分割/匹配/查找及替换操作. 正则表达式与通配符 通配符 正则与通配符的区别: 正则匹配字符串,通配符匹配文件名. 正则--->包含匹配 通配符--->完全 ...

  3. highcharts去掉版权|去掉水印链接(右下角)_

    credits: {                      enabled: false                  }

  4. Dota2 demo手游项目历程

    最近其实是打算认真研究c++ primer和设计模式的原著,然后写一些读书笔记的,不过设计模式原著里生词太多,大多都看的不是很明白,因此暂时放弃阅读设计模式,打算用这些时间做一个类似我叫mt2的手游d ...

  5. unixLike命令拾遗

    针对在日常工作过程中,发现的学习的漏洞和忘记的知识,进行拾遗. 编辑命令 一.vim操作 1.进入编辑模式 在光标移到将要编辑处,点击i,进入编辑模式 2.退出编辑模式 按esc或者crtl+c退出编 ...

  6. json-c与树

    json是一种轻量级的数据交换格式,因为其灵巧使得其在应用层开发以及接口层开发使用的十分广泛,最常用的莫过于协议交流使用json数据,比xml轻巧,又比二进制数据有规则.无论是各大公司的开放平台或者是 ...

  7. retrofit一点点理解

    retrofit是什么? retrofit可以认为是一款基于http协议的rpc框架.基于java的. 它可以连到支持restful的服务器,将服务器返回的json数据反序列化成java对象. 用途 ...

  8. POJ1753(位操作和枚举)

    题目:http://poj.org/problem?id=1753 题意:一块4*4的棋盘,黑白块不规律分布,翻动一个色块,其上下左右,都会被翻动,知道全黑全白为止.输出最小次数,达不到则输出“Imp ...

  9. oracle遇到的锁异常,oralce record is locked by another user

    由于我在前不久的一次项目调试的时候,将一条数据的ID与另一条数据的ID相同了,但不知为什么没有报错,当在页面发现问题时,删除这条数据时就报错了,oralce record is locked by a ...

  10. PHP 数据库连接工具类(MySQLI函数包装)

    ====================mysql===================== <?php class mysql { private $mysqli; private $resu ...