前言:

自己想额外创建一个Linux账户,但是发现新创建的用户(lgq)并不能使用sudo指令。

但是在安装系统时创建的用户(abc)是可以正常使用的。

原因是新创建的用户并没有被赋予使用sudo指令的权限。

解决方案:

1. 切换到能使用root权限的用户

(如我的abc用户)

su abc

2. 使用root权限修改sudoers文件

(sudoers文件规定了哪些用户可以使用root权限)

sudo vim /etc/sudoers

本文博客地址:http://www.cnblogs.com/toulanboy/

3. 在该文件中添加一行

(your_username是你想使用root权限的用户名)

your_username ALL=(ALL) ALL

4. 按Esc,输入:wq!保存退出

(注意,这是个只读文件,即使是root权限,也需要加!强制修改)

:wq!

参考:https://www.linuxidc.com/Linux/2010-12/30386.htm

Ubuntu sudo 出现 is not in the sudoers file解决方案的更多相关文章

  1. Linux遇到的问题(一)Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法

    提示错误信息 www@iZ236j3sofdZ:~$ ifconfig Command 'ifconfig' is available in '/sbin/ifconfig' The command ...

  2. ubuntu:xxx is not in the sudoers file. 问题解决

    ubuntu 下普通用户用 sudo 执行命令时报 "xxx is not in the sudoers file.This incident will be reported" ...

  3. 解决ubuntu系统“XXX is not in the sudoers file”错误

    用adduser新建的用户,当时只输入了一个用户名,没做其它操作,这样就建立了一个normal用户.在执行sudo vim hadoop-env.sh时,报“*** is not in the sud ...

  4. Ubuntu技巧之 is not in the sudoers file解决方法

    转自:http://www.linuxidc.com/Linux/2010-12/30386.htm 1)进入到root用户下. 2)添加文件的写权限.也就是输入命令"chmod u+w / ...

  5. Ubuntu sudo 免密码之 sudoers 修改

    Ubuntu sudo 免密码之 sudoers 修改 重要提示: 本文内容仅在虚拟机上实验通过.如果你不确信这个过程,请不要擅自改变/etc/sudoers.否则可能导致你的机器不可用.本文对由此产 ...

  6. sudo 使用不了, the permissions on the /etc/sudoers file are changed to something other than 0440

    sudo 使用不了,报错: the permissions on the /etc/sudoers file are changed to something other than 0440 how ...

  7. Ubuntu系统下解决“YourUserName不在sudoers文件中。此事将被报告”的问题

    本文由荒原之梦原创,原文链接:http://zhaokaifeng.com/?p=624 问题描述: 之前在使用Fedora系统时遇到过在使用 sudo 时提示"YourUserName不在 ...

  8. 解决linux下sudo更改文件权限报错xxxis not in the sudoers file. This incident will be reported.

    本文转自Linux社区作者为z-sm的文章 原文链接http://www.linuxidc.com/Linux/2016-07/133066.htm 之前一直使用的是ubuntu,后来安装了Cento ...

  9. ubuntu sudo update与upgrade的作用及区别

    ubuntu sudo update与upgrade的作用及区别 入门linux的同志,刚开始最迫切想知道的,大概一个是中文输入法,另一个就是怎么安装软件.本文主要讲一下LINUX安装软件方面的特点. ...

随机推荐

  1. 关于Dictionary的优化用法

    今天突然想到了解一下Dictionary,于是在博客园上看到了一篇关于用TryGetValue的文章,原来用TryGetValue要比用ContainsKey更快,快一倍.

  2. rpm与yum安装软件包

    首先,禁止用yum卸载删除软件包: 而应该使用rpm删除软件包 rpm qa | grep 软件包名 rpm -e --nodeps 要卸载的软件包

  3. oracle 数据库 存储过程

    destinct(去除重复行), to_char(转换自符串), to_date(日期格式函数), substr(截取自符串), lower(将字母转换为小写), upper(将字母转换为小写), t ...

  4. RS485的自动发送与布线

    布线http://blog.sina.com.cn/s/blog_729a492301019owo.html 自动收发电路:485注意控制端电平问题(3.3/5V)

  5. Docker容器与容器数据

    Docker容器与容器数据 image 与container 镜像(Image)和容器(Container)的关系,就像是面向对象程序设计中的 类 和 实例 一样,镜像是静态的定义,容器是镜像运行时的 ...

  6. C#oracle备份和还原

    最近公司的oracle备份工具不好使了,原来是公司的人用VB写的,由于我是主攻C#的,所以想着自己来写一个C#版本的oracle备份和还原工具. 一开始,我按照原来的设计思路来进行编写,想在pluss ...

  7. arcgis【0基础 】【1】 中如何添加MXD

    1,第一种方法 MapControl  直接添加 if (!axMapControl1.CheckMxFile(FileName)) { MessageBox.Show("文件不合法&quo ...

  8. two.js基本操作

    今天介绍一个网络上并不常用的插件two.js,two.js是一款网页二维绘图软件,可以在指定区域内产生自设的各种动画效果 下载网址如下: https://two.js.org/#download 一: ...

  9. map中使用await 异步函数

    let result=await Promise.all(dataComments.map(async (ele)=>{ return (async ()=>{ let resData= ...

  10. {ubuntu}不能挂载windows

    sudo apt-get install ntfs-3g sudo ntfsfix /dev/sda?