Number of minutes that can elapse before sudo will ask
for a passwd again. The timeout may include a frac‐
tional component if minute granularity is insufficient,
for example 2.5. The default is 15. Set this to 0 to
always prompt for a password. If set to a value less
than 0 the user's time stamp will never expire. This
can be used to allow users to create or delete their
own time stamps via “sudo -v” and “sudo -k” respec‐
As you can see, the default timeout of
sudo is 15 minutes. You can change this value in
You don't directly edit
/etc/sudoers, instead use
visudo to do it.
visudo edits the sudoers file in a safe fashion, analogous to vipw(8).
visudo locks the sudoers file against multiple simultaneous edits, pro‐
vides basic sanity checks, and checks for parse errors. If the sudoers
file is currently being edited you will receive a message to try again
sudo visudo in a terminal, which will open the
/etc/sudoers file in
Look for this line:
timestamp_timeout=X where X is the time you want to set in minutes.
So as an example:
If you specify 0, you will always be asked the password. If you specify a negative value, the timeout will never expire.
Once done, save and exit.