xxx not in the sudoers file.This incident will be reported
来源:互联网 发布:大数据 曾是规划 编辑:程序博客网 时间:2024/06/06 14:14
centos下普通用户用sudo执行命令时报如下错误:
"xxx is not in the sudoers file.This incident will be reported"
解决方法就是在/etc/sudoers文件里给该用户添加权限。
具体操作如下:
1.切换到root用户下
2./etc/sudoers文件默认是只读的,对root来说也是,因此需先添加sudoers文件的写权限,命令是:
chmod u+w /etc/sudoers
3.编辑sudoers文件
vi /etc/sudoers
找到这行
root ALL=(ALL) ALL
在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)
ps:这里说下你可以sudoers添加下面四行中任意一条
youuser ALL=(ALL) ALL
%youuser ALL=(ALL) ALL
youuser ALL=(ALL) NOPASSWD: ALL
%youuser ALL=(ALL) NOPASSWD: ALL
第一行:允许用户youuser执行sudo命令(需要输入密码).
第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码).
第三行:允许用户youuser执行sudo命令(不需要输入密码)
第四行:允许用户组youuser里面的用户执行sudo命令(不需要输入密码)
4.撤销sudoers文件写权限
命令:
"xxx is not in the sudoers file.This incident will be reported"
解决方法就是在/etc/sudoers文件里给该用户添加权限。
具体操作如下:
1.切换到root用户下
2./etc/sudoers文件默认是只读的,对root来说也是,因此需先添加sudoers文件的写权限,命令是:
chmod u+w /etc/sudoers
3.编辑sudoers文件
vi /etc/sudoers
找到这行
root ALL=(ALL) ALL
在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)
ps:这里说下你可以sudoers添加下面四行中任意一条
youuser ALL=(ALL) ALL
%youuser ALL=(ALL) ALL
youuser ALL=(ALL) NOPASSWD: ALL
%youuser ALL=(ALL) NOPASSWD: ALL
第一行:允许用户youuser执行sudo命令(需要输入密码).
第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码).
第三行:允许用户youuser执行sudo命令(不需要输入密码)
第四行:允许用户组youuser里面的用户执行sudo命令(不需要输入密码)
4.撤销sudoers文件写权限
命令:
chmod u-w /etc/sudoers
参考:
http://www.linuxidc.com/Linux/2016-07/133066.htm阅读全文
0 0
- Fix the problem: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.
- sodu时提示:XXX is not in the sudoers file. This incident will be reported
- xxx is not in the sudoers file. This incident will be reported的错误解决方案
- centos 修改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.
- 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.
- xxx is not in the sudoers file. This incident will be reported
- xxx is not in the sudoers file.This incident will be reported.的解决方法
- 【matlab】Peak SideLobe Ratio And Half Angle Width峰值旁瓣比和半功率角宽
- go的slice传参
- fill函数 和 memset 函数的区别
- leetcode 476: Number Complement
- iOS 分类增加属性
- xxx not in the sudoers file.This incident will be reported
- HtmlSpanner使用小结
- 怎样利用XAMPP搭建本地php环境
- 64 linux spi设备驱动之mcp2515(can控制器)驱动
- 秒懂,Java 注解 (Annotation)你可以这样学
- 小程序-倒计时
- fseek函数、ftell函数和rewind函数
- python [:]
- 数据库管理常用sql命令