The default password timeout is 15 minutes. So if you use sudo twice in 15 minutes (900 seconds), you will not be asked to type the user’s password again.
timestamp_timeout defines the number of minutes that can elapse before
sudo will ask for a password again. To modify the timestamp_timeout, edit the
I recommend you to use
visudo, when editing the
timestamp_timeout value to the
Defaults line, in
Defaults line to look like this:
timestamp_timeout=0 (zero) makes the sudo password expire every 0 (zero) seconds. This means that every time you use sudo, you will be asked for the password.
timestamp_timeout=-1 (minus one) makes the sudo password not expire.
from: Change Sudo Password Timeout