I am working on a simple web interface to change IPTABLES ports. I have a BASH IPTABLES script, that when I run it manually, works fine. With PHP, I run it, and it seems to run, but nothing happens. If I use passthru(), it gives me normal output as it does by running it manually, and that is it.
The file is chmoded 777 with owner nobody.nobody. nobody can not run it however as they do not have access to IPTABLES. When running commands such as passthru(), does it run the command as root or as what PHP is running as? Perhaps that is the problem, in some odd say.
I use PHP to search for the port list in MonMarta's IPTABLES file, and add/remove ports by parsing that string. It writes the output to a different file, then makes a backup of the original, and copies the new one over, then chmod's it to 777 and sets the owner to nobody.nobody. I know 777 is not that secure, but right now I just want it to work... 🙂
Any help would be appreciated for this problem. I need to have this buttoned up by the end of the week for work, and this is the ONLY thing I have left.
Thanks
Paul