---
title: "Linux下is not in the sudoers file解决方法"
author: "lalahei"
date: "2016-10-13T17:25:51Z"
tags: []
categories: ["操作系统"]
slug: "linux-is-not-in-the-sudoers-file"
draft: false
lastmod: "2016-10-13T17:25:51Z"
id: 2330396
url: "https://lalahei.iteye.com/blog/2330396"
---

当我们使用sudo命令切换用户的时候可能会遇到提示以下错误：xxx is not in the sudoers file. This incident will be reported，xxx是你当前的用户名，究其原因是用户没有加入到sudo的配置文件里

1、切换到root用户，运行visudo命令

2、在打开的配置文件中，找到root ALL=(ALL) ALL，在下面添加一行

xxx ALL=(ALL) ALL 其中xxx是你要加入的用户名称