How to extend your SUDO timeout

This annoyed me for a while. The default timeout on SUDO in Linux is pretty short …. and I wanted it extended.

The easy way to do it is:

sudo visudo

Then, look for the line:

Defaults        env_reset

From here, simply add to the end of the line:

Defaults        env_reset,timestamp_timeout=2

Where the 2 is the number of minutes you want your SUDO credentials to last before you’ll be asked to re-enter the password. No need to add a space between the comma.

Pretty easy.