Linux下is not in the sudoers file(转)

作者:佚名 上传时间:2019-05-22 版权申诉
用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。
1)进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root用)
(注意有- ,这和su是不同的,在用命令”su”的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用”su -”命令将环境变量也一起带过去,就象和root登录一样)
2)添加文件的写权限。也就是输入命令"chmod u+w /etc/sudoers"。
3)编辑/etc/sudoers文件。也就是输入命令"gedit /etc/sudoers",进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"www_linuxidc_com ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存退出。
4)撤销文件的写权限。也就是输入命令"chmod u-w /etc/sudoers"。
http://www.linuxidc.com/Linux/2010-12/30386.htm

当我们使用sudo命令切换用户的时候可能会遇到提示以下错误:xxx is not in the sudoers file. This incident will be reported,xxx是你当前的用户名,究其原因是用户没有加入到sudo的配置文件里

Linux下is not in the sudoers file(转)

切换到root用户,运行visudo命令
Linux下is not in the sudoers file(转)

在打开的配置文件中,找到root ALL=(ALL) ALL,在下面添加一行

xxx ALL=(ALL) ALL 其中xxx是你要加入的用户名称
Linux下is not in the sudoers file(转)

输入:wq保存并退出配置文件,再次使用sudo命令就不会有上面的提示了。

http://jingyan.baidu.com/article/2a1383284bb3e8074a134f2d.html

免责申明:文章和图片全部来源于公开网络,如有侵权,请通知删除 server@dude6.com

用户评论
相关推荐
Linuxis not in the sudoers file
用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户
Linux中“is not in the sudoers file”解决方法
最近虚拟机装了个RedHat Enterprise Server 5,用惯了Ubuntu,觉得不太适应。 当在终端执行sudo命令时,系统提示“cuser is not
[RedHat]“is not in the sudoers file”解决方法
当在终端执行sudo命令时,系统提示“luckchengis not in the sudoers file”: $ sudo ls Password
Linux有问必答:怎样解决“XXX is not in the sudoers file”错误
Linux有问必答:怎样解决“XXX is not in the sudoers file”错误 问题 :我想在我的Linux系统
Ubuntu技巧之"xxx is not in the sudoers file"解决方法
原文地址:http://www.linuxidc.com/Linux/2010-12/30386.htm 用sudo时提示"xxx is not in the sudoe
centos 删除文件夹 permission denied, xxx is not in the sudoers file.
centos 删除文件夹 permission denied 用 tar 命令解压出来的文件夹却带了个锁,无法删除; 如下图: 使用
如何解决在Linux中使用sudo时出现'用户is not in the sudoers file. This incident will be reporte
这个问题表明您尝试使用sudo执行命令,但是系统认为您不在sudoers文件中,因此无法获得sudo权限。解决这个问题的一种方法是通过root用户登录,编辑/etc/sudoers文件,将您的用户添加
任意版本
Linux
2024-03-04 16:02
Linux遇到的问题(一)Ubuntu报“xxx is not in the sudoers file.This incident will be report
提示错误信息 www@iZ236j3sofdZ:~$ ifconfigCommand 'ifconfig' is available in '/sbin/ifconfig'T
xxx is not in the sudoers file.This incident will be reported.的解决方法
本文转自: http://www.cnblogs.com/zox2011/archive/2013/05/28/3103824.html
xxx is not in the sudoers file.This incident will be reported.的解决方法
本文转自: http://www.cnblogs.com/zox2011/archive/2013/05/28/3103824.html