为什么没有sudoers文件:“ / etc / sudoers:没有这样的文件或目录”?


11

我正在尝试添加新的管理员用户,但是:

# adduser username admin
  adduser: The user `username' does not exist.
# man sudoers
  No manual entry for sudoers
# less /etc/sudoers
  /etc/sudoers: No such file or directory

系统是Debian 7(Wheezy)我在做什么错?


如果您CD到/ etc并使用ls命令,该文件是否存在?
Davidw

1
sudo软件包是否已实际安装?
Jaap Eldering

Answers:


23

在Debian系统上默认未安装Sudo。您应该以root身份发出:

apt-get install sudo

除此之外,还可以通过以下方式添加具有默认组的新用户:

useradd -G groupname username

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.