Ref:http://blog.sina.com.cn/s/blog_4aa35ca101012qb6.html

装完linux系统,发现普通用户无法使用sudo 命令,

提示:User1(普通用户)is not in the sudoers file, This incident will be reported.

大概意思是说User1这个用户不在sudoers这个文件里,这个事件将要被报告的。

我们可以这样做

[User1@localhost~]$su -    (切换到root)

输入超级用户root密码

[User1@localhost~]#chmod u+w /etc/sudoers    (添加root对sudoers这个文件的写权限)

[User1@localhost~]#vi /etc/sudoers           (编辑sudoers,把User1这个用户添加进去)

找到 root ALL=(ALL)        ALL 这行 ,并在此行下添加

User1 ALL=(ALL)        ALL

:wq  (保存并退出)

[User1@localhost~]#chmod u-w /etc/sudoers   (这里我们再把root对sudoers这个文件的写权限去掉,嘿嘿)

RedHat Linux下普通用户无法使用sudo命令的解决方法的更多相关文章

  1. linux下普通用户无法使用sudo命令问题

    今天在新装的linux虚拟机中使用sudo命令时,报错如下 We trust you have received the usual lecture from the local System Adm ...

  2. linux下为用户添加sudo命令功能

    为用户添加sudo命令功能: 打开etc下的sudoers文件 vi /etc/sudoers 在 root   ALL=(ALL)  ALL 下面添加如下一行,然后保存关闭 hadoop  ALL= ...

  3. linux 增加新用户无法使用sudo命令解决办法

    昨天一不小心把自己的系统搞崩了,也没有快照,没法进行还原操作,所以只能重装系统解决了,装完系统以后一切正常,当我新增了一个用户,使用sudo命令切换到root用户时,发现怎么都切换不过去,经过百度发现 ...

  4. linux下添加用户到sudo组 并禁止sudo用户修改密码

    linux下添加用户到sudo组 创建用户  useradd hanli 为新用户设置密码  passwd hanli 创建用户组  groupadd  op 将用户添加到用户组  usermod - ...

  5. Linux用户无法使用sudo命令

    新建的用无法使用sudo命令,出现这样的提示: xiaojing is not in the sudoers file. This incident will be reported 原来是新建的用户 ...

  6. linux下普通用户添加 sudo 免密码

    在使用普通用户登录的时候,会经常使用sudo指令执行一些操作,有时候感觉输入密码比较繁琐,特别是需要设置一些开机启动的时候操作,而这些操作往往就需要sudo指令,如果没有免密的话,在使用普通用户登录的 ...

  7. Linux下is not in the sudoers file解决方法

    最近在学习linux,在某个用户(xxx)下使用sudo的时候,提示以下错误:xxx is not in the sudoers file. This incident will be reporte ...

  8. [转]Linux下is not in the sudoers file解决方法

    来源: http://jingyan.baidu.com/article/2a1383284bb3e8074a134f2d.html 当我们使用sudo命令切换用户的时候可能会遇到提示以下错误:xxx ...

  9. Linux下DM无法显示建模界面的解决方法

    方法来源: http://www.linuxhospital.com/read/unable-to-resolve-function-glxqueryextension-in-hyperview.ht ...

随机推荐

  1. 备用shell管理方案之butterfly+nginx+https

    安装butterfly+nginx https 1. 安装butterfly yum install python36 python36-pip python36-devel -y pip insta ...

  2. select和C标签

    <select name="cpcyModel.rwzj" id="cpcyModel_rwzj"> <option value=" ...

  3. struts的带参数结果集

    action在forward过程中共享一个值栈,也就是一次request只有一个值栈,服务器端的forward对于客户端来说就是一次request,在forward过程就没必要再传参数了. 总结也就是 ...

  4. JWT Claims

    JWT Claims “iss” (issuer)  发行人 “sub” (subject)  主题 “aud” (audience) 接收方 用户 “exp” (expiration time) 到 ...

  5. JAVA基础之访问控制权限

    包:库单元 1.当编写一个Java源代码文件时,此文件通常被称为编译单元(有时也被称为转译单元). 2.每个编译单元都必须有一个后缀名.java,而在编译单元内则可以有一个public类,该类名称必须 ...

  6. log4j实现日志自动清理功能

    log4j不支持自动清理功能,但是log4j2版本支持,log4j2是log4j的升级版,比logback先进. log4j升级为log4j2(不需要改动代码)https://blog.csdn.ne ...

  7. System.Net.FtpWebRequest.cs

    ylbtech-System.Net.FtpWebRequest.cs 实现文件传输协议(FTP)客户端. 1.返回顶部 1. #region 程序集 System, Version=4.0.0.0, ...

  8. ISO/IEC 9899:2011 条款6.7.1——存储类说明符

    6.7.1 存储类说明符 语法 1.storage-class-specifier: typedef extern static _Thread_local auto register 约束 2.在一 ...

  9. Spark获取DataFrame中列的几种姿势--col,$,column,apply

    1.doc上的解释(https://spark.apache.org/docs/2.1.0/api/java/org/apache/spark/sql/Column.html)  df("c ...

  10. pytorch torch.nn.functional实现插值和上采样

    interpolate torch.nn.functional.interpolate(input, size=None, scale_factor=None, mode='nearest', ali ...