3

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)?

keddad
  • 523

2 Answers2

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
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