返回顶部

Linux将一般用户加入sudo组

Linux将一般用户加入sudo组

报错:xxx is not in the sudoers file. This incident will be reported

系统:Centos8

主要是要修改/etc/sudoers

1、切换到那个root用户,

​ $ su - root

2、编辑配置文件 /etc/sudoers

​ $ vim /etc/sudoers

​ 找到“root ALL=(ALL)”,在它的下面添加一行

​ ”用户名“ ALL=(ALL) ALL

​ 或者 ”用户名“ ALL=(ALL) NOPASSWD:ALL

保存退出,root用户也需要wq!才可以保存。

  1. 切换至普通用户,进行测试

测试成功!

posted @ 2021-02-01 21:26  张十三S  阅读(132)  评论(0编辑  收藏  举报