在刚刚使用RadHat Linux的时候,在执行sudo指令的时候,输入密码结束之后还是出现用户名 is not in the sudoers file,原因是当前的用户并没有添加到sudoers file中。
解决方案:
我们切换成root用户,在终端输入:su,回车。然后在输入root的密码。
然后执行:visudo,如下图:

找到如下内容:
root ALL=(ALL) ALL,如下图所示:
root ALL=(ALL) ALL,如下图所示:

添加上自己的用户名,格式要和原版一样即可。