前言:

自己想额外创建一个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. Flask (四) 模型进阶

    模型进阶 多对多关联 用户收藏电影,一个用户可以收藏多部电影, 一部电影可以被不同的用户收藏, 是一个多对多关系. ​ # 中间表(不是模型) collects = db.Table('collect ...

  2. GYM 101673F(树计数)

    树上每个割点计算一下各个size的组合相乘再相加为第一问答案,取最大的:再把本答案中最大的两个size相乘减掉,为第二问答案. const int maxn = 1e4 + 5; int n, siz ...

  3. wmq的队伍 BIT优化dp

    http://oj.xjtuacm.com/problem/14/ wmq的队伍 发布时间: 2017年4月9日 17:06   最后更新: 2017年4月9日 17:07   时间限制: 2000m ...

  4. hdu3642Get The Treasury

    链接 刚开始看n挺小,以为是二维的线段树,想了一会也没想到怎么解,之后看到z值非常小,想到可以直接枚举z,确定一个坐标,然后把三维转化为二维,把体积转化为面. 枚举z从-500到500,然后用面积并的 ...

  5. Bingding模型

    public abstract class Binding : IDefaultCommunicationTimeouts public virtual IChannelListener<TCh ...

  6. 创建对象js.

    JavaScript中的基本书记类型. Number(数值类型) String(字符串类型) boolean(布尔类型) null(空类型) undefined(未定义类型) object 常见的内置 ...

  7. dos命令安装windows服务

    以下两种方法都是通过dos命令创建windows服务 1.创建服务 sc create UploadRealVolumeService start= auto binpath= C:\Users\Ad ...

  8. 学习cocos2dx3.1.0

    static_cast<type-id>expression 该运算符把expression转换为type-id类型 Lambda表达式  CallFunc::create([=](){} ...

  9. Azure Powershell 获取可用镜像 PublisherName,Offer,Skus,Version

    #登录 $username="{登录名}" #定义一个用户账号的变量,可以输入需要登录的订阅账号名称 $password=ConvertTo-SecureString -Strin ...

  10. PHP 常用的无限遍历方法

    一.根据父节点ID循环遍历其下所有子节点 /** * @name 根据id递归某个父类节点下的所有分类节点 * @author tbj * @date 2015-12-19 */ public fun ...