我是 sudoer 并且不知何故不在 sudoers 文件中?

Tim*_*son -1 sudo

我正在尝试运行sudo apt-get update

我将粘贴我的最后一个输出,试图将自己“添加”到 sudoers 文件中(我认为我在,但不断收到错误说我不是......)

timothy@AMDx6:~$ sudo nano /etc/inittab
[sudo] password for timothy: 
timothy is not in the sudoers file.  This incident will be reported.
timothy@AMDx6:~$ su
Password: 
root@AMDx6:/home/timothy# visudo
visudo: /etc/sudoers.tmp unchanged
root@AMDx6:/home/timothy# sudo adduser timothy
adduser: The user `timothy' already exists.
root@AMDx6:/home/timothy# exit
exit
timothy@AMDx6:~$ sudo apt-get update
[sudo] password for timothy: 
timothy is not in the sudoers file.  This incident will be reported.
timothy@AMDx6:~$ 
Run Code Online (Sandbox Code Playgroud)

Jul*_*ier 5

sudo 并不是说用户不存在,只是说它不在 sudoers 文件中。

adduser 是添加系统用户的脚本,而不是 sudoers 文件中的条目。

要执行您想要的操作,您需要授予timothywith权限visudo。检查man sudoers详细信息。