Ubuntu支持特定用户使用sudo指令

81 阅读1分钟

解决 user is not in the sudoers file. This incident will be reported.报错。将用户名添加到sudoers文件。

sudo passwd your_user_name # 没有设置密码的设置一下
su root #切换到root用户
sudo adduser your_user_name sudo  # 将指定用户添加到sudoers文件
su your_user_name # 回到指定用户
# 使用sudo指令...

使用sudo指令报错

发生 user is not in the sudoers file. This incident will be reported. 报错。报错信息已经说的很清楚对应的用户不在sudoers 文件中。 image.png

切换到root用户,将指定用户添加到sudoers文件

image.png

回到指定用户

image.png

使用sudo指令

image.png