Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The first time a user enters sudo foo, sudo_root prompts for the password. For a certain duration after that, sudo_root doesn't prompt for a password for any subsequent sudo foo's in that terminal session.

  • What duration is that?
  • Can the duration be changed?
share|improve this question
up vote 9 down vote accepted

This is covered in the Ubuntu Sudo FAQ entry here:

The default is 15 minutes, but can be changed with *timestamp_timeout* in /etc/sudoers. For more details see "man sudoers"

share|improve this answer
Here's a cheatsheet from… type sudo visudo go the line that says Defaults env_reset and change it to Defaults env_reset , timestamp_timeout=X with X in minutes – belacqua Feb 2 '11 at 21:20
FYI: sudo -k invalidates an active sudo session. That is useful if you've huge timestamp_timeout values and do not plan to do any sudo stuff in the next minutes. – Lekensteyn Jun 15 '11 at 8:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.