在Linux操作系统中,以普通用户使用sudo时,常常会出现这个报错,如:
[oracle@dbahaoyuan ~]$ sudo ifconfig
[sudo] password for oracle:
oracle is not in the sudoers file. This incident will be reported.
[oracle@dbahaoyuan ~]$
报错给出原因是用户oracle不在sudo的配置文件中,oracle用户无法使用sudo;
首先:
以root用户修改/ete/sudoer,在root ALL=(ALL) ALL 行下添加 oracle ALL=(ALL) ALL
[root@dbahaoyuan etc]# chmod u+w sudoers
[root@DBA2 etc]# vi sudoers
添加 oracle ALL=(ALL) ALL
将sudoer属性改回原值:
[root@dbahaoyuan etc]# chmod u-w sudoers
[root@dbahaoyuan etc]# ll sudoers
-r--r----- 1 root root 3402 AUG 1 11:39 sudoers
再试试sudo的命令,可以使用了;
[oracle@dbahaoyuan ~]$ sudo ifconfig
[sudo] password for oracle:
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30031456/viewspace-1425947/
,如需转载,请注明出处,否则将追究法律责任。