xueyanxiang is not in the sudoers file. This incident will be reported

原因:切换到root用户需要使用 sudo 命令,但是,该新建用户没有使用该命令的权限。
解决办法:使用root用户在/etc/sudoers文件中,把该新用户添加进去,让能够使用所有命令权限即可。
1.切换到超级用户:$ su
2.打开/etc/sudoers文件:$vim /etc/sudoers
3.修改文件内容:
找到“root ALL=(ALL) ALL”一行,在下面插入新的一行,内容是“hadoop ALL=(ALL) ALL”,然后在vim键入命令“:wq!”保存并退出。
注:这个文件是只读的,不加“!”保存会失败。
4.退出超级用户:$ exit

网友评论