allowing sudo to delete certain files
- by chandank
I would like to allow to delete certain files in /tmp directory to sudo users. I have added the Allow_Cmnd /usr/sbin/userdel for sudo users but this does not delete all /tmp files associated with the user.
So how shall I tweak the sudoers to allow them to delete certain files in /tmp directory only. I googled a bit but learned that regex may be be application at this. I tried couple of tweaks but its not working for me.
I would like the users to have ability to execute command such as
find /tmp -uid 10002 | grep joeuser | xargs rm -rf