end*_*ith 19 linux sudo passwords fish ubuntu-11.04
Ubuntu 中的 sudo 不断向我询问每个命令的密码。以前,我只需要输入一次密码,然后就会记住一段时间。这最近发生了变化,可能是在“升级”到 Natty 之后。
我已经完成sudo visudo
并设置Defaults env_reset, timestamp_timeout = 60
,尝试重新启动,但它仍然无法正常工作。我该如何解决?
经过以下建议,我/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:endolith timestamp_timeout=60
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
#includedir /etc/sudoers.d
Run Code Online (Sandbox Code Playgroud)
更新:
我升级了我的 VirtualBox,它开始遇到同样的问题。猜测一下,我运行了 bash,并尝试在其中执行 sudo,并且正确记住了密码。只有当我使用默认的贝壳鱼时,它才不记得。它在之前的 Ubuntu 版本中确实如此,但不再如此。
更新:
我升级到 13.05,这神奇地再次开始工作。现在它询问我的密码一次,停止询问一段时间,然后在一段时间后再次询问。
小智 15
@endolith:是的,它似乎只影响鱼。我遇到了同样的问题,问题是由 sudo 选项“tty_tickets”引起的。在您的 /etc/sudoers 文件上禁用此功能将解决问题。
以下将禁用 tty_tickets:
Defaults env_reset,!tty_tickets
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6862 次 |
最近记录: |