I am pretty sure sudo is configured properly, because if I run "sudo
iptables ....." from the command prompt while logged as opensips user, it
works fine.

Here is what I have in /etc/sudoers:

opensips        ALL=(ALL)       NOPASSWD: /sbin/iptables

opensips process runs as 'opensips'




2013/9/20 Stefano Pisani <[email protected]>

>  are you sure to know how to configure sudo?
> please post the user used by openSIPS and sudo configuration (sudoers)
>
>
>
> Il 20/09/2013 19.11, Dragomir Haralambiev ha scritto:
>
>  Hello everyone,
>
> I am trying to execute 'iptables' from opensips in the script, which works
> if opensips runs as root. However if opensips is configured to run as
> non-privileged user, in order to control iptables, I have to call iptables
> via sudo. Command works on the command prompt when executed manually under
> the user opensips run as, but does not seem to execute if run by opensips
> itself.
>
> This is how I try to call it:
>
> exec_msg("/usr/bin/sudo /sbin/iptables -A INPUT -s $si -p udp -j DROP");
>
> log file says command is executed, but the firewall rules do not get
> updated.
>
> Any idea why?
>
>
> _______________________________________________
> Users mailing 
> [email protected]http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to