Re: sudo selectively execute file, * wildcard on dir set with "(ALL) NOPASSWD:".

"Aaron C. de Bruyn" <[email protected]> Tue, 5 Jan 2010 08:08:05 -0800
Newsgroups org.kernel.vger.linux-config,org.kernel.vger.linux-admin
Message-ID <20100105160805.GB3433@chrysalis>
On 2010-01-05 at 17:08:37 +0800, Kent Ho wrote:
> I then copy script1.sh to a new file in the same directory as "script2.sh".
> Now I execute "script1.sh" again with sudo, now it will execute.

Read the docs.

From the sudo man page:

-k          The -k (kill) option to sudo invalidates the user's timestamp
by setting the time on it to the Epoch.  The next time sudo is run a
password will be required.  This option does not require a password and
was added to allow a user to revoke sudo permissions from a .logout file.

-A