[clug] Problem with sudo

Alex Satrapa grail at goldweb.com.au
Tue Jul 5 21:44:06 MDT 2011


I'm trying to get sudo to allow me to run the command:
 asterisk -rx 'sip reload'

But I'm encountering some problems.

Here's how sudoers is set up:

> Cmnd_Alias RELOAD_SIP = asterisk -rx 'sip reload'
> 
> my-group ALL=(root)NOPASSWD:RELOAD_SIP

So when I issue "sudo -l" I'll see:
> User grail may run the following commands on this host:
>   (root) NOPASSWD: asterisk -rx 'sip reload'

However any attempt to actually invoke that command will fail:

sudo asterisk -rx 'sip reload'
-> Sorry, user grail is not allowed to execute 'asterisk -rx sip reload' as root on hostname

sudo asterisk -rx 'sip\ reload'
-> Sorry, user grail is not allowed to execute 'asterisk -rx sip\ reload' as root on hostname

… and various other nonsense.

Any suggestions on how to get the string "sip reload" passed to asterisk? "sip" and "reload" as separate words won't help.

Alex



More information about the linux mailing list