FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


exec() with root privileges





quartz
Hi,

I need to reload service from my php script, but to do this root access is required.

How to execute command with root privileges?

OS Linux FC4
ml
isn't it:
Code:
exec("su some_command");
quartz
sudo asks for password... it is not possible to enter it from php script (maybe im wrong?)
to let sudo without password for apache user is not secure
kv
Run your apache as root. This makes your system too vulnerable for attacks but it works. The workaround is to have scripts set with su ("s") bits and allow normal user to run scripts in super user mode.
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.