CentOS7──xxx is not in the sudoers file

Posted VMT

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7──xxx is not in the sudoers file相关的知识,希望对你有一定的参考价值。

提示"xxx is not in the sudoers file. This incident will be reported.其中 ”XXX“是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。
下面是修改方法:
1)进入超级用户模式。打开‘Open Terminal‘ 输入"su",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root权限) 
2)添加文件的写权限。"[[email protected] 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的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu:xxx is not in the sudoers file. 问题解决

Lettuce: Connection to xxx not allowed. This partition is not known in the cluster view.

Lettuce: Connection to xxx not allowed. This partition is not known in the cluster view.

Lettuce: Connection to xxx not allowed. This partition is not known in the cluster view.

LinuxWARNING: The script locust is installed in ‘/home/xxx/bin‘ which is not on PATH.

CocoaPods报错:The dependency `xxx` is not used in any concrete target