Admin privs timeout

(Phil Stokes) #1

When using sudo on the command line, it’s good practice to follow it with sudo -K, which resets the timestamp on the sudoers file, meaning another sudo command immediately following it will also require a password.

Is there any way to kill the elevated privs that are acquired by ‘do shell script…with administrator privileges’ immediately after executing the command to achieve the same effect as sudo -K?

(Shane Stanley) #2

I don’t know if this helps, but TN2065 says:

Once a script is correctly authenticated, it will not ask for authentication again for five minutes. As of Mac OS X 10.4, this grace period does not extend to any other scripts or to the rest of the system; manually calling sudo -k is unnecessary.

(Phil Stokes) #3

Oops, sorry. I thought I’d read that doc a thousand times already. I guess 1001 was all I needed.