<div dir="ltr"><div>Hello everyone,</div><div> </div><div>I am trying to execute &#39;iptables&#39; 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.</div>
<div> </div><div>This is how I try to call it:</div><div> </div><div>exec_msg(&quot;/usr/bin/sudo /sbin/iptables -A INPUT -s $si -p udp -j DROP&quot;); </div><div> </div><div>log file says command is executed, but the firewall rules do not get updated.</div>
<div> </div><div>Any idea why?</div></div>