sudo’s default password cache time is 5 minutes. To change the default time, it is possible to edit a setting in /etc/sudoers as desired. I’ll show you how!
Edit /etc/sudoers with your desired text editor, or as standard with sudo visudo:
$ sudo visudo
For example, to increase the timeout to 30 minutes for user jsmith, you would put in a line as follows at the bottom of the file:
A value of 0 makes sudo always ask for a password. In other words, 0 disables the cache.
If set to a value below 0 (ex, -1) the cache will never expire. You should of course never do this, but alas, the option is available.