受到这个问题的启发......
我是唯一一个在 12.04 上使用我的系统的人。
每次我发出sudo命令;系统要求输入用户密码(这有其自身的好处)。
然而我在想;无需激活root账户;如何执行不会要求用户密码进行身份验证的 sudo 命令。
注意:我想在不通过密码进行身份验证的情况下执行 sudo 命令;只有当它们通过终端执行时。
我不想从其他功能中删除这一额外的安全层,例如在使用“Ubuntu 软件中心”或通过将 something.sh 文件拖放到终端来执行 bash 脚本时。
每当我发出命令时,sudo apt-get install foo它都不会要求输入密码。是因为用户组吗?
如何让它提示输入密码?
编辑:我的 sudoers 文件
apple@Ascension:~$ sudo cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL …Run Code Online (Sandbox Code Playgroud)