I am attempting to modify the sudoers files located within the sudoers.d directory to allow a group named "swts" to perform a cp and chown as part of an automation job. To accomplish this, I created a Cmnd_Alias as follows and saved in file called /etc/sudoers.d/00-cmds-swts:
Cmnd_Alias SWTS_COMMANDS = /usr/bin/cp -r * /home/bbc/leo/BQD*, /bin/chown -R bbc:bbc /home/bbc/leo/BQD*
However, when using visudo to edit the file and attempting to save, I receive the following error:
>>> 00-cmds-qa: syntax error near line 1 <<<
I am not sure what I am missing. Is it something with the source for the cp command?
I finally utilized the command alias in another file under /etc/sudoers.conf/swts-users which has below contents:
%swts ALL=(bbc:bbc) NOPASSWD: SWTS_COMMANDS