I want to add an entry to my suoders to allow one user to run a command with exactly one non-option argument.
# tail -1 /etc/sudoers
ALL ALL = (:tool) NOPASSWD: /bin/echo [a-z]*
$ sudo -g tool /bin/echo abc def
abc def
$ sudo -g tool /bin/echo -abc def
[sudo] password for user:
Can I do that using the sudoers sytnax? Or do I need to create a helper script?
[a-z]*
is already the argument I want. So it's a variable argument. (I use /bin/echo just for testing.)