is not in the sudoers file
来源:互联网 发布:交通安全事故数据 编辑:程序博客网 时间:2024/05/17 20:10
问题
Linux系统无法使用sudo指令
方法一
1. 查找sudoers位置(默认会在/etc/sudoers) [tianshl@tianshl ~]# whereis sudoers sudoers: /etc/sudoers /etc/sudoers.bak /usr/share/man/man5/sudoers.5.gz2. 切换到root身份 [tianshl@tianshl ~]# su -3. 修改sudoers权限 [root@tianshl ~]# chmod u+w /etc/sudoers4. 把用户添加到sudoers中 [root@tianshl ~]# vi /etc/sudoers 1. 找到 "root ALL=(ALL)" 2. 另起一行输入 "tianshl ALL=(ALL) ALL" 备注:tianshl为用户名 修改后如下所示: ## Allow root to run any commands anywhere root ALL=(ALL) ALL tianshl ALL=(ALL) ALL5. 去掉sudoers的写权限 [root@tianshl ~]# chmod u-w /etc/sudoers6. 退出root用户后就可以利用sudo命令来执行管理员权限了。
注:如果不去掉写权限,系统不允许执行suoders文件,运行sudo命令时会出现以下错误: sudo: /etc/sudoers is mode 0640, should be 0440
方法二
1.首需要切换到root身份 [tianshl@tianshl ~]# su -2. 执行visudo [root@tianshl ~]# visudo 1、移动光标,到最后一行 2、按a,进入append模式 3、输入 "tianshl ALL=(ALL) ALL" 备注:tianshl为用户名 4、按Esc 5、输入“:wq”3. 这样就可以自己加入sudo组使用sudo命令了。
阅读全文
0 0
- is not in the sudoers file
- xxx is not in the sudoers file
- Fedora is not in the sudoers file
- user is not in the sudoers file
- xxx is not in the sudoers file
- xx is not in the sudoers file
- xxx is not in the sudoers file.
- xx is not in the sudoers file
- is not in the sudoers file
- *** is not in the sudoers file 问题解决
- *** is not in the sudoers file 问题解决
- is not in the sudoers file解决方法
- is not in the sudoers file 解决
- xxx is not in the sudoers file
- xx is not in the sudoers file
- is not in the sudoers file
- is not in the sudoers file解决方法
- is not in the sudoers file解决方法
- 梯度下降小结
- 【基础】查看程序运行所需时间--C++源代码(g++ 4.9.3)
- Scrapy 框架
- 离开快两年了。
- 菜鸟学习历程【2】vim的简单操作、GCC工具链、make和Makefile、GDB调试工具、Shell使用基础
- is not in the sudoers file
- JDK和Cglib动态代理
- 一致性哈希算法及其在分布式系统中的应用
- java笔试题50道
- Scrapy的安装介绍
- 立冬出生的宝宝取名大全测试打分准不准
- 入门案例
- 第一届嵌入式电子协会竞赛之智能家居控制系统
- LeetCode-153:Find Minimum in Rotated Sorted Array (可能旋转的排序数组中的最小值) -- medium