第一句子网 - 唯美句子、句子迷、好句子大全
第一句子网 > Hadoop之——Linux下sudo命令报错:hadoop is not in the sudoers file. This incident will be reported.

Hadoop之——Linux下sudo命令报错:hadoop is not in the sudoers file. This incident will be reported.

时间:2024-01-04 04:15:20

相关推荐

Hadoop之——Linux下sudo命令报错:hadoop is not in the sudoers file. This incident will be reported.

转载请注明出处:/l1028386804/article/details/93380235

当在终端执行sudo命令时,系统提示“cuser is not in the sudoers file”:

具体报错信息为:

-bash-4.1$ sudo vim /etc/profileWe trust you have received the usual lecture from the local SystemAdministrator. It usually boils down to these three things:#1) Respect the privacy of others.#2) Think before you type.#3) With great power comes great responsibility.[sudo] password for hadoop: hadoop is not in the sudoers file. This incident will be reported.

其实就是没有权限进行sudo,解决方法如下(这里假设用户名是hadoop):

1.切换到root用户:$ su

2.打开/etc/sudoers文件:$vim /etc/sudoers

3.修改文件内容:

找到“root ALL=(ALL) ALL”一行,在下面插入新的一行,内容是“hadoop ALL=(ALL) ALL”,

然后在vim键入命令“wq!”保存并退出。

注:这个文件是只读的,不加“!”保存会失败。

4.退出root用户:$ exit

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。