I edit in visudo the following , in order to enable user to remove any folder or file under /var/log/http/ include sun folder

 UserT ALL=(root) NOPASSWD: sudoedit /var/log/http/*

user can remove file or folder under /var/log/http/*

but not sub folders/files unde /var/log/http/ , as /var/log/http/hT/*

I also edit the visudo with

UserT ALL=(root) NOPASSWD: /bin/rm -r /var/log/http/hT/*

and I do

sudo rm -r /var/log/http/hT/GG/file.txt

[sudo] password for UserT:
Sorry, user UserT is not allowed to execute '/bin/rm -r file' as root on 

what need to fix here in order to remove also the sub folders/files under /var/log/http/../../../../


This is possible by changing the user permission for /var/log/http/hT directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.