By default, sudo remembers your password for 15 minutes (on most distributions) before it asks you for it again. If you find this annoying, you can change this to something else by following this guide.
one should NEVER open the
/etc/sudoersfile with a normal text editor. always usesudo visudo.
- Open the
/etc/sudoersfile by running:
sudo visudo
- Append the following line to the end of the file, replacing
30with the number of minutes you want as your timeout.
Defaults timestamp_timeout=30
Note that if you set it to 0 it will ask for a password every time, and if you set it to -1 it will make the session last forever (until you log out/reboot)
you might also want to show asterisks when typing your password like so:
cinar@fedora ~$ sudo -v
[sudo] password for cinar: *************
or you might want to insult users who mistype their password or even make the lecture text always show up. in either case, click the relevant link.