Linux Sudo xxx is not in the sudoers file 的解决方法
2017-01-05 23:00
706 查看
有些命令我们用普通用户执行时权限不够,但是直接用root用户又有风险,这时我们要用sudo临时获取权限
但是往往会出现
xxx is not in the sudoers file. This incident will be reported.
解决方案:
首需要切换到root身份
$su -
(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用"su -"命令将环境变量也一起带过去,就象和root登录一样)
然后
$visudo //此处没有vi和sudo之间没有空格
1、移动光标,到最后一行
2、按a,进入append模式
3、输入
your_user_name ALL=(ALL) ALL //是你要添加进去的username,不是这几个字
4、按Esc
5、输入“:w”(保存文件)
6、输入“:q”(退出)
这样就把自己加入了sudo组,可以使用sudo命令了。
但是往往会出现
xxx is not in the sudoers file. This incident will be reported.
解决方案:
首需要切换到root身份
$su -
(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用"su -"命令将环境变量也一起带过去,就象和root登录一样)
然后
$visudo //此处没有vi和sudo之间没有空格
1、移动光标,到最后一行
2、按a,进入append模式
3、输入
your_user_name ALL=(ALL) ALL //是你要添加进去的username,不是这几个字
4、按Esc
5、输入“:w”(保存文件)
6、输入“:q”(退出)
这样就把自己加入了sudo组,可以使用sudo命令了。
相关文章推荐
- [转]Linux之"xxx is not in the sudoers file"解决方法
- linux系统使用sudo命令报xxx is not in the sudoers file.This incident will be reported.的解决方法
- 【Linux学习】Linux报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法
- Linux遇到的问题(一)Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法
- Linux中“xxx is not in the sudoers file”解决方法
- Linux_服务器_03_xxx is not in the sudoers file.This incident will be reported.的解决方法
- [转]Linux下is not in the sudoers file解决方法
- xxx is not in the sudoers file.This incident will be reported.的解决方法
- xxx is not in the sudoers file.This incident will be reported.的解决方法
- Linux下is not in the sudoers file解决方法
- Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法
- Linux下is not in the sudoers file解决方法
- Linux下is not in the sudoers file解决方法
- xxx is not in the sudoers file. This incident will be reported解决方法
- xxx is not in the sudoers file.This incident will be reported.的解决方法
- xxx is not in the sudoers file.This incident will be reported.的解决方法
- xxx is not in the sudoers file.This incident will be reported.的解决方法
- xxx is not in the sudoers file.This incident will be reported.的解决方法
- Linux下is not in the sudoers file解决方法
- xxx is not in the sudoers file.This incident will be reported.的解决方法