Sample Header Ad - 728x90

sudoers syntax error near line 1 while adding cmnd alias

2 votes
1 answer
1603 views
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
Asked by Rahul Kodumuru (61 rep)
Feb 23, 2023, 05:04 PM
Last activity: Feb 24, 2023, 01:58 PM