Linux下is not in the sudoers file解决方法

本文遵循BY-SA版权协议,转载请附上原文出处链接。


本文作者: 黑伴白

本文链接: http://heibanbai.com.cn/posts/f25e58a2/

Linux下is not in the sudoers file解决方法

当我们使用sudo命令切换用户的时候可能会遇到提示以下错误:用户名 is not in the sudoers file.

原因

当前的用户没有加入到sudo的配置文件里

解决方案

1
2
3
4
5
6
7
#切换到root用户
su
#编辑配置文件
vim /etc/sudoers
#增加配置, 在打开的配置文件中,找到root ALL=(ALL) ALL, 在下面添加一行
#其中xxx是你要加入的用户名称
xxx ALL=(ALL) ALL

蚂蚁再小也是肉🥩!


Linux下is not in the sudoers file解决方法
http://heibanbai.com.cn/posts/f25e58a2/
作者
黑伴白
发布于
2021年3月12日
许可协议

“您的支持,我的动力!觉得不错的话,给点打赏吧 ୧(๑•̀⌄•́๑)૭”

微信二维码

微信支付

支付宝二维码

支付宝支付