When you run sudo
it won't ask a password for at least 5 minutes after you last ran it. You can change this timeout by adding Defaults timestamp_timeout=0
to sudoers
with sudo visudo
. This also instantly locks it.
My question is if there is a way to do it just once, and without visudo
.
You can do this with the
sudo
-K
or-k
options: