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. Mysql 压力测试工具 mysqlslap

    转载至文章作者:杜亦舒 链接:https://www.sdk.cn/news/4512 来源:SDK.cn 摘要:mysqlslap 是 Mysql 自带的压力测试工具,可以模拟出大量客户端同时操作数 ...

  2. Python中正则模块re.compile、re.match及re.search函数用法

    import rehelp(re.compile)'''输出结果为:Help on function compile in module re: compile(pattern, flags=0) C ...

  3. [pixhawk笔记]6-uORB流程及关键函数解析

    本文中将结合代码.文档及注释,给出uORB执行流程及关键函数的解析,由于uORB的机制实现较为复杂,所以本文主要学习如何使用uORB的接口来实现通信.回到上一篇笔记中的代码: #include < ...

  4. 20145322第一次JAVA实验报告

    20145322第一周JAVA实验报告 课程:Java程序设计 班级:1453 指导教师:娄嘉鹏 实验名称:Java开发环境的熟悉(Linux + Eclipse) 实验日期:2016.04.08 实 ...

  5. python-作用域和装饰器

    Python 作用域 学习的时机: 基本的数据类型 Python的运算 数字运算 + - * / // ** 逻辑运算 And or not 比较运算 > < == >= <= ...

  6. Jenkins 集成Ansible教程

    前提条件: 1. 部署Jenkins Server 2. 部署 Ansible Server 一.在Jenkins安装SSH插件 系统管理 -> 插件管理 二.在Jenkins 凭证中添加Ans ...

  7. optind变量

    1.这个变量是在什么地方定义的? 答:系统定义的 2.这个变量在什么场景下使用? 答:在解析命令行参数时会用到 3.这个变量存在的意义? 在每调用一次getopt()或getopt_long()类似函 ...

  8. Springboot--配置文件注解

    使用注解1 1.resouse中新建application.proprities jdbc.username=root jdbc.password=123 jdbc.driverClassName=f ...

  9. python的socket的tcp协议编程

    服务端代码如下: # _*_ coding:utf-8 _*_import socketimport datetimeHOST='0.0.0.0'PORT=3434 s=socket.socket(s ...

  10. Spring容器基础xmlbeanfactory(一起看源码)

    在spring中,如果你想创建容器少不了使用常见的xmlbeanfactory,ClassPathXmlApplicationContext,FileSystemXmlApplicationConte ...