transparent sudo?

mlh at zip.com.au mlh at zip.com.au
Thu Jul 31 07:06:37 EDT 2003


1. Create a directory for commands that you want sudo'd,
   say, /usr/local/sudobin

2. Put the a file with the following in it, call it sudowrapper.

   PATH=/usr/bin:/bin:/usr/local/bin
   export PATH
   exec sudo "$0" "$@"

3. create links for every file that you want to sudo in it:
   cd /usr/local/sudobin
   ln -s sudowrapper cancel
   ln -s sudowrapper apachectl
   ln -s sudowrapper shutdown
   ... etc...

4. put this dir first in the $PATH of the users you want
   to have transparent access to sudo with.


You have to be careful which commands you do this with.
Be mindful that they won't be able to execute the non-sudo
version of the command without giving a full pathname to
the command.


Matt



More information about the sudo-users mailing list