I want to be able to give a user on a system I administrate the ability to access file X, using command Y using sudo.
Is there a way to do this while allowing some flexibility over the arguments to command Y?
The following:
user ALL=NOPASSWD: /usr/bin/X /path/to/Y
Will allow the user to run X with Y as its only argument, but what if I wanted to allow the user to supply some optional arguments to X?
This:
user ALL=NOPASSWD: /usr/bin/X * /path/to/Y
Wouldn't be secure, as the the user could use the wildcard to to pass additional file arguments to X. I'd need something more restrictive.
Can I do this simply with sudo? Or do I need to use a different method?