Work out sudo timeout instantly with clear inputs, formula shown and shareable results.
sudo caches successful authentication per terminal for timestamp_timeout minutes, defaulting to 15 on most distributions. The trade-off is direct: a shorter window means more prompts but a smaller period in which an unattended or hijacked terminal grants root without a password. Setting it to 0 requires a password every time.
Prompt frequency
if the gap between commands exceeds the timeout, every command prompts; otherwise prompts ~ ceil(session duration / timeout)
Per terminal by default via tty_tickets, so authenticating in one shell does not grant access in another. Disabling tty_tickets makes it per user and is less safe.
Only for specific tightly scoped commands used by automation, never for ALL. A NOPASSWD entry for a shell or an editor is equivalent to passwordless root.