1.切换到root用户下,怎么切换就不用说了吧,不会的自己百度去.



2.添加sudo文件的写权限,命令是:

chmod u+w /etc/sudoers



3.编辑sudoers文件

vi /etc/sudoers

找到这行 root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)



ps:这里说下你可以sudoers添加下面四行中任意一条

youuser            ALL=(ALL)                ALL

%youuser           ALL=(ALL)                ALL

youuser            ALL=(ALL)                NOPASSWD: ALL

%youuser           ALL=(ALL)                NOPASSWD: ALL



第一行:允许用户youuser执行sudo命令(需要输入密码).

第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码).

第三行:允许用户youuser执行sudo命令,并且在执行的时候不输入密码.

第四行:允许用户组youuser里面的用户执行sudo命令,并且在执行的时候不输入密码.



4.撤销sudoers文件写权限,命令:

chmod u-w /etc/sudoers



这样普通用户就可以使用sudo了.

普通用户开通sudo权限:xxx is not in the sudoers file.This incident will be reported.的解决方法的更多相关文章

  1. sudo 提示 'xxx is not in the sudoers file.This incident will be reported.的解决方法'

    在使用 Linux 的过程中,有时候需要临时获取 root 权限来执行命令时,一般通过在命令前添加 sudo 来解决. 但是第一次使用 sudo 时,有可能会得到这样一个错误提示 xxx is not ...

  2. centos添加和删除用户及 xxx is not in the sudoers file.This incident will be reported.的解决方法

    修改主机名:vim /etc/sysconfig/network 1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 # ...

  3. 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 ...

  4. 解决:xxx is not in the sudoers file.This incident will be reported.的解决方法

    Linux中普通用户用sudo执行命令时报”xxx is not in the sudoers file.This incident will be reported”错误,解决方法就是在/etc/s ...

  5. 企业运维案例:xxx is not in the sudoers file.This incident will be reported” 错误解决方法

    CentOS6系统下,普通用户使用sudo执行命令时报错: xxx is not in the sudoers file.This incident will be reported" 解决 ...

  6. xxx is not in the sudoers file.This incident will be reported.的解决方法 (一般用户不能执行sudo)

    1.切换到root用户下 2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers 3.编辑sudoers文件vi /etc/sudoers找到这行 root ALL=(AL ...

  7. Ubuntu——"xxx is not in the sudoers file.This incident will be reported" 错误解决方法

    Ubuntu下普通用户用sudo执行命令时报如题所示错误,解决方法就是在/etc/sudoers文件里给该用户添加权限.如下: 1.切换到root用户下 2./etc/sudoers文件默认是只读的, ...

  8. xxx is not in the sudoers file.This incident will be reported.的解决方法

    1.切换到root用户下,怎么切换就不用说了吧,不会的自己百度去. 2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers 3.编辑sudoers文件vi /etc/sud ...

  9. xxx is not in the sudoers file. This incident will be reported的解决方法

    1>.进入超级用户模式.也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式.(当然,你也可以直接用root用户登录,因为红旗安装过后默认的登录 ...

随机推荐

  1. 有界、无界队列对ThreadPoolExcutor执行的影响

    本文转载自https://blog.csdn.net/kusedexingfu/article/details/72491864 Java提供了4钟线程池: newCachedThreadPool n ...

  2. Linux使用free命令查看实际内存占用

    转自:http://www.cnblogs.com/pengdonglin137/p/3315124.html Linux下在终端环境下可以使用free命令看到系统实际使用内存的情况,一般用free ...

  3. 好用的http client库CPP REST SDK

    前言 C++中http client库本身就少,好用的就更少了,在了解微软开源的CPP REST SDK库之前,我知道的C++ http client库有libcurl(这个是C语言的),Qt的QNe ...

  4. java switch笔记

    1. 在Java7之前,switch只能支持byte.short.char.int或者其对应的封装类以及Enum类型 2. Java7后,开始支持String 3. switch语句中,表达式的值不能 ...

  5. 20145313张雪纯 《Java程序设计》第5周学习总结

    20145313张雪纯 <Java程序设计>第5周学习总结 教材学习内容总结 JAVA中所有错误都会被打包成对象,可以用尝试(try)捕捉(catch)代表错误的对象后做一些处理.使用tr ...

  6. 20144303 《Java程序设计》第八周学习总结

    20144303 <Java程序设计>第八周学习总结 教材学习内容总结 第十五章 1.日志API简介: java.util.logging包提供了日志功能相关类与接口,不必额外配置日志组件 ...

  7. Seccon2017-pwn500-video_player

    感觉这个题目并不值500分,有些地方比较牵强,漏洞也比较明显,解题方法有多种,出题者把堆的布局随机化了,不过使用fastbin doublefree的话,可以完全忽视被打乱的堆. from pwn i ...

  8. Hive架构

    Hive组织数据包含四种层次:DataBase --> Table --> Partition --> Bucket,对应在HDFS上都是文件夹形式. 数据库和数据仓库的区别: 1) ...

  9. [LOJ6145]Easy

    题意给出一棵树,每次询问一个点$x$到编号在$[l,r]$中的点的距离的最小值.$n,q\le 10^5$ 大概是最简单的动态点分治了,注意开大数组即可,如果改成求最大值这道题会有意思很多 代码: # ...

  10. Centos7服务器搭建VNC Server环境

    在企业级项目的开发中,尤其是分布式项目,经常直接在服务器上进行开发工作,操作系统环境一般是Centos 7.普遍状况是,在服务器上安装IDE 开发工具,通过 Xshell等工具远程启动,本地通过虚拟桌 ...