用sudo时提示"xxx is not in the sudoers file. "
2013-01-05 11:38
579 查看
用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。
1.下面是修改方法:
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"。
2.另一种修改sudoers的方法
sudo都提供了一个编辑该文件的命令:visudo来对该文件进行修改。强烈推荐使用该命令修改 sudoers,因为它会帮你校验文件配置是否正确,如果不正确,在保存退出时就会提示你哪段配置出错的。
(改命令需超级用户:su -) visodo /bin/sudoers
1.下面是修改方法:
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"。
2.另一种修改sudoers的方法
sudo都提供了一个编辑该文件的命令:visudo来对该文件进行修改。强烈推荐使用该命令修改 sudoers,因为它会帮你校验文件配置是否正确,如果不正确,在保存退出时就会提示你哪段配置出错的。
(改命令需超级用户:su -) visodo /bin/sudoers
相关文章推荐
- Ubuntu技巧之"xxx is not in the sudoers file"解决方法
- 使用用sudo时提示"### 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"解决方法
- Fedora提示 xxxis not in the sudoers file.this incident will be reported解决办法 [转]
- "xxx is not in the sudoers file"解决方法
- Fedora提示 xxxis not in the sudoers file.this incident will be reported解决办法
- Fedora提示 xxxis not in the sudoers file.this incident will be reported解决办法
- Fedora提示 xxxis not in the sudoers file.this inc...
- sodu时提示:XXX is not in the sudoers file. This incident will be reported
- The Solution to "xxx is not in the sudoers file"
- Zox's code life 人生就是不停的战斗! xxx is not in the sudoers file.This incident will be reported.的解决方法
- [转]Linux之"xxx is not in the sudoers file"解决方法
- Ubuntu——"xxx 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.的解决方法
- 解决centOS下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.This incident will be reported.的解决方法
- Linux中“xxx is not in the sudoers file”解决方法