You should also be able to do this (at least you can on Linux, it may be different on OSX) by setting the
timestamp_timeout to 0 in
/etc/sudoers. This is the time for which the password is remembered . On most Linux distributions, the default is set at 15 minutes. Setting it to
0 means that
sudo will prompt for a password every time it is run. To change it do the following:
sudo visudo, this will open a
vim session allowing you to edit
Hit i to enter INSERT mode
Add this line
Hit Esc to exit INSERT mode
Hit :wqEnter to save the file and exit.
sudo will always ask for a password, even if you have just given it one. If you think this is too strict, you can use a higher value, say
5 for five minutes or
0.5 for 30 seconds.