Usually, when I run
sudo, it will ask me to enter a password the first time and it will remember that I'm authenticated for the next few minutes, until that authentication times out.
This leaves a hole in the system's security. Coupled with a bit of social engineering, a malicious shell-script/Makefile/etc. could run
sudo inside it and gain access to root.
Without giving up the convenience of the "remember authentication" feature, I would still like to have a more secure setup. Is there a way to set up
sudo to only remember authentication for the pid that authenticated successfully, or something similar? I know that you can configure
sudo to ask for authentication every time, but I'm thinking of something that doesn't forgo the convenience for the security.