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 ...
随机推荐
- Java 使用Jedis和RedisTemplate操作Redis缓存(SpringBoot)
package com.example.redis.controller; import com.example.redis.entity.User; import com.example.redis ...
- SpringBoot配置虚拟化路径用于图片的展示
前言:springboot默认可以访问resources下的static文件夹下的静态资源,我们一般将图片指定上传到static下的某个文件夹,例如images,开发阶段可以使用,但是当项目打成jar ...
- go中的方法以及自定义类型代码示例
package main import "fmt" type user struct { name string age int sex string } type admin s ...
- 深度学习面试题17:VGGNet(1000类图像分类)
目录 VGGNet网络结构 论文中还讨论了其他结构 参考资料 2014年,牛津大学计算机视觉组(Visual Geometry Group)和Google DeepMind公司的研究员一起研发出了新的 ...
- ionic生命周期函数
Ionic4中的生命周期函数和angualr7基本是一样的,下面我们看看Ionic4中的生命周期函数,以及生命周期函数的用法. Ionic4中内置的生命周期函数: ionViewWillEnter — ...
- C++11中的std::bind
C++11中的std::bind 最近在看看cocos2dx的源代码,发现了cocos2dx 3.0相对于2.0改动了很多,最大的改变就是大量的使用了C++11的特性,比如auto等.其中有一个关于回 ...
- Spring cloud微服务安全实战-_5-10实现基于session的SSO(Token有效期)
refresh_token过期了怎么办,虽然可以设置一个比较长的有效期,但是终归还是要过期的. 只能从认证服务器重新走认证授权的流程. 两种情况 1,session还没过期的,跳过去之后,直接就知道你 ...
- 【FreeMarker】Spring MVC与FreeMarker整合(二)
前一篇介绍了FreeMarker的基本使用,本例介绍Spring MVC与FreeMarker整合 不熟悉项目搭建,可参考 [FreeMarker]FreeMarker快速入门(一) 整合 1.新建S ...
- React错误收集
1. Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/ ...
- 报错:org.apache.sqoop.common.SqoopException Message: CLIENT_0001:Server has returned exception NoClassDefFoundError: org/codehaus/jackson/map/JsonMappingException
报错背景: CDH集成sqoop2服务之后,创建好link和job之后,执行job的时候报错. 报错现象: sqoop:> start job -j Exception has occurred ...