RedHat Linux下普通用户无法使用sudo命令的解决方法
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命令的解决方法的更多相关文章
- linux下普通用户无法使用sudo命令问题
今天在新装的linux虚拟机中使用sudo命令时,报错如下 We trust you have received the usual lecture from the local System Adm ...
- linux下为用户添加sudo命令功能
为用户添加sudo命令功能: 打开etc下的sudoers文件 vi /etc/sudoers 在 root ALL=(ALL) ALL 下面添加如下一行,然后保存关闭 hadoop ALL= ...
- linux 增加新用户无法使用sudo命令解决办法
昨天一不小心把自己的系统搞崩了,也没有快照,没法进行还原操作,所以只能重装系统解决了,装完系统以后一切正常,当我新增了一个用户,使用sudo命令切换到root用户时,发现怎么都切换不过去,经过百度发现 ...
- linux下添加用户到sudo组 并禁止sudo用户修改密码
linux下添加用户到sudo组 创建用户 useradd hanli 为新用户设置密码 passwd hanli 创建用户组 groupadd op 将用户添加到用户组 usermod - ...
- Linux用户无法使用sudo命令
新建的用无法使用sudo命令,出现这样的提示: xiaojing is not in the sudoers file. This incident will be reported 原来是新建的用户 ...
- linux下普通用户添加 sudo 免密码
在使用普通用户登录的时候,会经常使用sudo指令执行一些操作,有时候感觉输入密码比较繁琐,特别是需要设置一些开机启动的时候操作,而这些操作往往就需要sudo指令,如果没有免密的话,在使用普通用户登录的 ...
- Linux下is not in the sudoers file解决方法
最近在学习linux,在某个用户(xxx)下使用sudo的时候,提示以下错误:xxx is not in the sudoers file. This incident will be reporte ...
- [转]Linux下is not in the sudoers file解决方法
来源: http://jingyan.baidu.com/article/2a1383284bb3e8074a134f2d.html 当我们使用sudo命令切换用户的时候可能会遇到提示以下错误:xxx ...
- Linux下DM无法显示建模界面的解决方法
方法来源: http://www.linuxhospital.com/read/unable-to-resolve-function-glxqueryextension-in-hyperview.ht ...
随机推荐
- 记一次清理缓存的小事情(chrome) chrome下清理缓存不生效的问题
记一次清理缓存的小事情(chrome) chrome下清理缓存不生效的问题 前端开发中会经常涉及清理缓存的事情. 在一次开发后, 需要清理缓存,一个哥们怎么清理都不生效, 于是向我求救. 在我看了下后 ...
- Kafka 深入核心参数配置
Kafka 真是一个异常稳定的组件,服务器上我们部署了 kafka_2.11-1.0.1 版本的 kafka 除了几次计算时间太长触发了 rebalance 以外,基本没有处理过什么奇怪的问题. 但是 ...
- Pytest权威教程14-缓存:使用跨执行状态
目录 缓存:使用跨执行状态 使用方法 首先只重新运行故障或故障 上次运行中没有测试失败时的行为 新的config.cache对象 检查缓存内容 清除缓存内容 逐步修复失败用例 unittest.Tes ...
- storcli64和smartctl定位硬盘的故障信息
storcli64可对LSIRAID卡基本操作进行管理,本文主要是对LSIRAID卡常使用到的命令进行介绍 https://www.cnblogs.com/wangl-blog/archive/201 ...
- nginx报警:nginx: [warn] could not build optimal server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64; ignoring server_names_hash_bucket_size
date: 2019-08-12 16:33:05 author: headsen chen notice :个人原创 告警现象: 解决办法:在http的部分添加hash缓冲值 测试:如下图, ...
- Syntax error: "(" unexpected shell里面的报错解决
author:headsen chen date : 2019-08-08 11:11:38 notice : 个人原创 Ubuntu上运行shell脚本总是报下面这个错误,在centos下面或者 ...
- mac中matplotlib不支持中文的解决办法
参考:https://blog.csdn.net/kaizei_pao/article/details/80795377 首先查看matplotlib已加载的字体: import matplotlib ...
- Python利用ctypes实现按引用传参
C的代码 void test_cref(char *a, int *b, char *data) { , sizeof(char)); strcpy(p, "cute"); a[] ...
- 【Mybatis】MyBatis之配置多数据源(十)
在做项目的过程中,有时候一个数据源是不够,那么就需要配置多个数据源.本例介绍mybatis多数据源配置 前言 一般项目单数据源,使用流程如下: 单个数据源绑定给sessionFactory,再在Dao ...
- NETTY option参数
Channel配置参数 (1).通用参数 CONNECT_TIMEOUT_MILLIS : Netty参数,连接超时毫秒数,默认值30000毫秒即30秒. MAX_MESSAGES_PER_REA ...