为什么 sudo 命令在我的新安装的 Debian 上不起作用。输入 root 密码后出现此错误:
抱歉,请再试一次 ..
或/和
密码尝试错误
编辑:在我的 /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
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
myuser ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
我确信我输入的密码正确。
更新:
当系统锁定屏幕时,我无法登录。这是身份验证日志:
polkitd(authority=local): Unregistered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session8 (system bus name :1.124, object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
答案1
sudo
命令需要当前用户的密码,而不是root
用户的密码。如果你想通过 root 密码授权,你可以使用su -
。