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

解决方法
1、登录root

su --login

2、 进入etc 文件夹

cd /etc

3、 修改sudoers文件为可读可写

chmod +777 sudoers

4 、修改sudoers 文本

vi sudoers 

按i 插入找到下面一行内容添加 “wang ALL=(ALL) ALL”

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
wang    ALL=(ALL)       ALL   ##这个是我本机账户添加

按“Esc”键退出插入模式
输入

:eq

按回车退出。
5、权限修改为440

chmod 440 sudoers

6、退出

exit

历史命令
[root@localhost ~]# history
1 cd /etc
2 ls
3 cd …
4 exit
5 cd /etc
6 ll
7 ll |grep sudoers
8 chomd +777 sudoers
9 chmod +777 sudoers
10 ll |grep sudoers
11 vi sudoers
12 chmod 440 sudoers
13 ll |grep sudoers
14 exit
15 history
[root@localhost ~]#

  • 6
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值