首页 > 其他 > 详细

CentOS7──xxx is not in the sudoers file

时间:2017-08-23 14:23:44      阅读:1142      评论:0      收藏:0      [点我收藏+]
提示"xxx is not in the sudoers file. This incident will be reported.其中 ”XXX“是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。
下面是修改方法:
1)进入超级用户模式。打开‘Open Terminal‘ 输入"su",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root权限) 
2)添加文件的写权限。"[root@localhost admin]"下,输入命令"chmod u+w /etc/sudoers"。 
3)编辑sudoers文件。输入命令"vim /etc/sudoers",输入"a"进入编辑模式,找到这一 行:"Allow root to ruan any commands anywhere"在【root ALL=(ALL) ALL】下面一行添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存(就是先按一 下Esc键,然后输入":wq")退出。 
4)撤销sudoers文件的编写权限。输入命令"chmod u-w /etc/sudoers"
5)"XXX"用户获得了权限。

CentOS7──xxx is not in the sudoers file

原文:http://www.cnblogs.com/vmtauto/p/7417795.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!