I have a script that runs from user that don't have permission for read\etc files in directory and script uses command below:
sudo /bin/find /var/log/some_logs -name "*access.log"
There is a pack of logs which names like bla-bla-access.log, I want to return all its names. I want to give the permission to that user for running this command
I did in visudo the next:
my_user ALL=(root) NOPASSWD: /bin/find /var/log/some_logs -name "*access.log"
But it doesn't work
It works only if I do the next:
my_user ALL=(root) NOPASSWD: /bin/find
But I don't want give the permission for using "find" in all directories.
Kindly help with this issue.