You are not logged in.
is there a way for me to execute a command as root from the php shell_exec() command? I am trying to create a simple web interface for my phone to preform simple server operations such as restart deamons.
in my php file im calling
$output = shell_exec('/path/to/my/script.py');
my script will do a /etc/rc.d/insert_daemon restart so it needs to be ran as root
I have tried to add
nobody=ALL :/path/to/my/script.py
to my sudoers file. i have also tried using
chmod 4755 script.py
chown root script.py
on the script. nothing seems to work for me.
I realize this is probably a security risk. anyone have any suggestions?
Last edited by murfMan (2010-04-11 17:09:48)
Offline
solved it:
added
http ALL=NOPASSWD :/path/to/script.py
to sudoers
Last edited by murfMan (2010-04-11 17:13:43)
Offline