xxx is not in the sudoers file. This incident will be reported的解决方法
2014-03-15 15:42
891 查看
我们在Linux系统上执行sudo命令时,有时候会报如下错误:xxx is not in the sudoers file. This incident will be reported。
出现这个问题,是因为执行sudo命令的用户不在sudoers文件的列表中。可以通过编辑sudoers文件,来解决这个问题。
编辑sudoers文件有两种办法,一种是以root帐号执行vi sudo,另一种是root帐号执行vi /etc/sudoers.其实两者都是修改/etc/sudoers。
假设你的用户名是“tuzhu”,属于“tuzhu”用户组。
为了让用户tuzhu能够执行sudo命,你可以在sudoers文件中加上一下四行的任意一行。
第一行:允许用户tuzhu执行sudo命令(需要输入密码)。
第二行:允许用户组tuzhu里面的用户执行sudo命令(需要输入密码)。
第三行:允许用户tuzhui执行sudo命令,并且在执行的时候不输入密码。
第四行:允许用户组tuzhu里面的用户执行sudo命令,并且在执行的时候不输入密码。
当然如果你理解上面的原理后,可以直接输入如下命令解决此问题
出现这个问题,是因为执行sudo命令的用户不在sudoers文件的列表中。可以通过编辑sudoers文件,来解决这个问题。
编辑sudoers文件有两种办法,一种是以root帐号执行vi sudo,另一种是root帐号执行vi /etc/sudoers.其实两者都是修改/etc/sudoers。
假设你的用户名是“tuzhu”,属于“tuzhu”用户组。
为了让用户tuzhu能够执行sudo命,你可以在sudoers文件中加上一下四行的任意一行。
tuzhu ALL=(ALL) ALL %tuzhu ALL=(ALL) ALL tuzhu ALL=(ALL) NOPASSWD:ALL(出于方便,推荐使用此设置) %tuzhu ALL=(ALL) NOPASSWD:ALL说明:
第一行:允许用户tuzhu执行sudo命令(需要输入密码)。
第二行:允许用户组tuzhu里面的用户执行sudo命令(需要输入密码)。
第三行:允许用户tuzhui执行sudo命令,并且在执行的时候不输入密码。
第四行:允许用户组tuzhu里面的用户执行sudo命令,并且在执行的时候不输入密码。
当然如果你理解上面的原理后,可以直接输入如下命令解决此问题
su - echo 'xxx ALL=(ALL) ALL' >> /etc/sudoers (其中xxx代表用户名)
相关文章推荐
- 【Linux学习】Linux报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法
- Linux报“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遇到的问题(一)Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法
- linux系统使用sudo命令报xxx is not in the sudoers file.This incident will be reported.的解决方法
- 普通用户开通sudo权限:xxx is not in the sudoers file.This incident will be reported.的解决方法
- xxx is not in the sudoers file.This incident will be reported.的解决方法
- 普通用户开通sudo权限:xxx is not in the sudoers file.This incident will be reported.的解决方法
- Ubuntu报“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_服务器_03_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的解决方法
- Zox's code life 人生就是不停的战斗! 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.的解决方法