Why is it so? Comfort I guess. You wouldn't use sudo if you had to type your password every 2 seconds.
sudo
does not remember your password. sudo
remembers the date, user and terminal. If a sudo
command in the same terminal is executed by the same user in a short period of time (15 minutes by default), sudo
just doesn't ask for the password again.
sudo
needs your password to make sure you are really you, and not someone else while you're away drinking coffee. it does not need your password to switch to root, since it runs as root.
If, from the same terminal, you run some malware within the grace period, the malware may be able to sudo
without a password.
You may use sudo -k
to invalidate the cache.
Are you sure keyring itself is used for
– node_analyser Oct 20 '16 at 09:07sudo
?