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. 切换至普通用户,进行测试

测试成功!

实战为王,记录在工作中技术使用的点点滴滴
原文地址:https://www.cnblogs.com/kaikai-wanna-know/p/14359117.html