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

ShineLee / 2023-08-03 / 原文

学习自:user is not in the sudoers file. This incident will be reported 解决方法_一路奔跑94的博客-CSDN博客

1、原因

没有在权限文件中说明该用户具有sudo权限

2、解决步骤

1)以root身份去/etc/sudoers文件中,编辑

vi /etc/sudoers

2)在root ALL=(ALL) ALL之下添加一行

xxx ALL =(ALL) ALL

3)保存退出,:wq!

4)再切换为该用户,即可sudo执行之前的命令了