[Solved][Help] Run PHP function as root?

Don´t be shy, Linux is fun! =)
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

[Solved][Help] Run PHP function as root?

Post by ayu »

I fucked up the server totally while trying to do this (will write about it later...because it was unfucking believable)

Anyway, I'm trying to make a PHP page where i can edit iptables, to make it easier and faster to forward ports on the server. The problem is that I need to be able to run the PHP functions as root either by not having to type in the password or that there is some kind of way that I can sudo the command and send the password as an argument at the same time...

Anyone familiar with this?
Last edited by ayu on 24 May 2008, 06:27, edited 1 time in total.
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

hm....have a look at this one:
http://freshmeat.net/projects/firewalladmin/

but I highly recommend to use this (and any other php script that has root privileges) only locally...never remotely (at least not without password protection)... :wink:

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

yay, at least this one had a good guide on how to NOT fuck the sudoers file up :D

Works like a charm, using password protection on the web root and all of the subdirectories, and the server is only reachable from my LAN =)

Thanks ^^
"The best place to hide a tree, is in a forest"

Post Reply