2

Here is my original /etc/sudoers.d/www file:

Cmnd_Alias WWWCMDS = /home/xxx/shop/update.sh
www-data ALL=(ALL) NOPASSWD: WWWCMDS

I simply want to add two additional commands so I RTFM and saw that you just have to comma-separate them.

Cmnd_Alias WWWCMDS = /home/xxx/shop/update.sh,geoipupdate,service memcached restart
www-data ALL=(ALL) NOPASSWD: WWWCMDS

But it triggered a syntax error. What am I doing wrong ?

  • You are using visudo to edit that file aren't you? – roaima Oct 4 '18 at 7:58
  • 1
    Yes, visudo -f /etc/sudoers.d/www – iizno Oct 4 '18 at 8:06
4

I just needed to provide the full path for the two additional commands.

Cmnd_Alias WWWCMDS = /home/xxx/shop/update.sh,/usr/local/bin/geoipupdate,/usr/sbin/service memcached
www-data ALL=(ALL) NOPASSWD: WWWCMDS

and it worked fine.

| improve this answer | |
  • 1
    That is fairly known behaviour. I like the cat ;) Welcome, btw +1 for the effort of documenting your own question. – Rui F Ribeiro Oct 4 '18 at 8:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.