19
5
sudo in Ubuntu keeps asking me for my password for every command. Previously, I only had to enter the password once, and then it would be remembered for a period of time. This recently changed, probably after "upgrading" to Natty.
I've done sudo visudo
and set Defaults env_reset, timestamp_timeout = 60
, tried rebooting, but it's still not working. How do I fix this?
After suggestions below, my /etc/sudoers
looks like this:
#
# 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
Update:
I upgraded my VirtualBox and it started to suffer from the same problem. At a guess, I ran bash, and tried to sudo in that, and the password is remembered correctly. It's only when I use my default shell fish that it doesn't remember. It did in the previous Ubuntu release, but no longer.
Update:
I upgraded to 13.05 and this magically started working again. Now it asks for my password once, stops asking for a while, and then asks again after a period of time.
possible duplicate: http://superuser.com/questions/148665/linux-unix-how-to-enable-one-user-to-sudo-without-a-password
– warren – 2011-07-21T21:05:55.9003@warren: That's not a duplicate. I should be required to enter the password, but after I have entered it once, I don't have to for a given amount of time. I have changed this amount of time with visudo in the past but it's not working anymore. – endolith – 2011-07-21T21:16:03.687
I think that you have to use multiple Defaults statements, rather than one common separated one. – Stephanie – 2011-07-22T04:25:05.490
@Stephanie, I am certain that having a single Defaults statement with comma separated values works fine. – Zoredache – 2011-07-22T06:16:38.693
i see you have added a line like
Defaults:endolith timestamp_timeout=60
, but you are not in any group called endolith, accordidng to another comment here. so what username are you using? Check withwhoami
, and add that username in place ofendolith
inDefaults:endolith timestamp_timeout=60
orendolith ALL=(ALL) NOPASSWD: ALL
– wim – 2011-07-25T12:07:37.423@wim: yes, I'm in the right group, which I wrote as "username" – endolith – 2011-07-25T12:59:38.697
Group "username" is not mentioned in the file. Try adding
endolith ALL=(ALL) ALL
right underroot ALL=(ALL:ALL) ALL
– frabjous – 2011-08-08T04:53:20.550