If I invoke sudo, but wait for some time without entering the password, it will exit with timeout. Are there any way to change this behavior (make time before timeout longer or eliminate it completely)?
Asked
Active
Viewed 1,379 times
2 Answers
8
Yes: see man sudoers
. There is an option passwd_timeout
which can be changed. You can either set the global default, or else change it on a per-command basis.

mattdm
- 40,245
-
How can I set this on a per-command basis? – Dan Dec 09 '23 at 20:51
0
Create /etc/sudoers.d/passwd_timeout and in it declare the number of minutes which may pass before having to retype the password in the same session:
Defaults:ALL timestamp_timeout=480
It didn't work when I named the file 'timeout'. I also was not allowed to use sudo -T for some other protection reason. (Debain 12/Bookworm) Note: We are supposed to use visudo to edit such a file, but I sudo echo the one-liner then chmod 440.

Paul
- 210