【简单易懂】user is not in the sudoers file. This incident will be reported.(Centos系统)

        这篇文章非常简单,接下来你只需要粘贴我的操作代码,输入要修改的用户名即可。

【简单易懂】user is not in the sudoers file. This incident will be reported.(Centos系统)_第1张图片

        在这里非常简单,意思就是“XXX不在sudoers档案中。这一事件将被报道”。我们只需要将用户名添加进去即可。

        在linux中ctrl+del是拷贝,shift+del是粘贴

1. 切换至root用户

su root

2. 修改/etc/sudoers文件权限为可写

chmod 777 /etc/sudoers

3. 修改/etc/sudoers文件,在root下面添加用户名

nano /etc/sudoers

        按住 ↓ 键,往下滑找到root,在root下面输入用户名          ALL=(ALL)        ALL即可,然后ctrl+x退出,输入Y,按回车即可

【简单易懂】user is not in the sudoers file. This incident will be reported.(Centos系统)_第2张图片

4. 恢复/etc/sudoers文件权限

chmod 440 /etc/sudoers

        以上,我们就将你要添加的用户放进文件,你也可以添加多个用户。如果你有更好的方法,欢迎在评论区讨论交流。如果你感觉这篇文章有用,点赞收藏评论。【简单易懂】user is not in the sudoers file. This incident will be reported.(Centos系统)_第3张图片

你可能感兴趣的:(Linux杂货铺,Linux,学习)