xxx is not in the sudoers file解决方法
2011-11-09 13:15
666 查看
解决方案:
首需要切换到root身份
$su -
(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用"su -"命令将环境变量也一起带过去,就象和root登录一样)
然后
$visudo //切记,此处没有vi和sudo之间没有空格
1、移动光标,到最后一行
2、按a,进入append模式
3、输入
your_user_name ALL=(ALL) ALL
4、按Esc
5、输入“:w”(保存文件)
6、输入“:q”(退出)
这样就把自己加入了sudo组,可以使用sudo命令了。
xxx is not in the sudoers file解决方法
用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。下面是修改方法:
1)进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root用)
2)添加文件的写权限。也就是输入命令"chmod u+w /etc/sudoers"。
3)编辑/etc/sudoers文件。也就是输入命令"vim /etc/sudoers",输入"i"进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存(就是先按一 下Esc键,然后输入":wq")退出。
4)撤销文件的写权限。也就是输入命令"chmod u-w /etc/sudoers"。
文章出处:飞诺网(www.diybl.com):http://www.diybl.com/course/6_system/linux/Linuxjs/2008106/148261.html
首需要切换到root身份
$su -
(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用"su -"命令将环境变量也一起带过去,就象和root登录一样)
然后
$visudo //切记,此处没有vi和sudo之间没有空格
1、移动光标,到最后一行
2、按a,进入append模式
3、输入
your_user_name ALL=(ALL) ALL
4、按Esc
5、输入“:w”(保存文件)
6、输入“:q”(退出)
这样就把自己加入了sudo组,可以使用sudo命令了。
xxx is not in the sudoers file解决方法
用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。下面是修改方法:
1)进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root用)
2)添加文件的写权限。也就是输入命令"chmod u+w /etc/sudoers"。
3)编辑/etc/sudoers文件。也就是输入命令"vim /etc/sudoers",输入"i"进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存(就是先按一 下Esc键,然后输入":wq")退出。
4)撤销文件的写权限。也就是输入命令"chmod u-w /etc/sudoers"。
文章出处:飞诺网(www.diybl.com):http://www.diybl.com/course/6_system/linux/Linuxjs/2008106/148261.html
相关文章推荐
- xxx is not in the sudoers file解决方法
- 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” 错误解决方法
- CentOS 6 xxx is not in the sudoers file解决方法
- 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(wsh) is not in the sudoers file.This incident will be reported.的解决方法
- Ubuntu技巧之"xxx 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 和 Authority XXX 不能sudo解决方法
- xxx is not in the sudoers file解决方法
- xxx 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解决方法
- Ubuntu技巧之"xxx is not in the sudoers file"解决方法
- 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.的解决方法
- 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.的解决方法