Jump to content

Adjusting iptables useing exec() or system()


oj

Recommended Posts

:) heya guys, ive hit a wall, thought id ask for help and here i am.

My problem is that im trying to update my iptables firewall useing a command that works in a terminal but not written into a page useing the system() or exec() commands.  i am useing apache ID'd as apache useing sudo NOPASSWD: ALL option opposed to running apache as root and having to recompile the source with the special option (which i cant get to work, but thats for another thread).

my script is a one liner.

<?php
system('/usr/bin/sudo /sbin/iptables -I INPUT 1 -s 1.1.1.1/32 -d 192.168.156.51 -p all -j ACCEPT');
?>

This is all thats stopping me from finishing this site module,

Thanks in advance

8)

Link to comment
https://forums.phpfreaks.com/topic/64610-adjusting-iptables-useing-exec-or-system/
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.