Centos7 执行sudo命令时,系统提示is not in the sudoers file. This incident will be reported.解决办法

 

22020309128 信安一班28号 黄宏伟

 

 

d87a95568a474cf5aeea89dd2f2ef603.png

systemctl start NetworkManager.service

打开网络服务

systemctl enable NetworkManager.service

开机启动网络服务

 

 

 

366b3f1e6d9d43c1bdba960e8f4ea951.png

ip同一网段就可以

c345194955614ab6911d1004ea3997c1.png

ip同一网段就可以

78396993549c4d098f002b12777ac24c.png

f41c5053327a4956af453911773ee4b0.png

如图,在终端执行sudo命令时,系统提示

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

原因就是当前的用户没有加入到sudo的配置文件里

解决方法:

  1. #切换到root用户

  2. su

  3. #编辑配置文件

  4. vim /etc/sudoers

  5. #找到root ALL=(ALL) ALL, 在下面添加一行, xxx是用户名称

  6. xxx ALL=(ALL) ALL

使用root用户执行以下命令,再ping

chmod u+s /bin/ping

22020309128 信安一班 hhw

 

 

 

 

 

 

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值