Quote:
Originally Posted by camperjohn64
cPanel and Webmin and others run as root. So this can't be that tough, or that insecure.
Can I tie a specific port like to 123.45.67.89:5000 to my php script and have it run as root there?
|
No, they do not run as root...
shell_exec('sudo -u root -S command_goes_here < /home/$User/dir/dir/dir/passfile');
There are a variety of methods...
You either need to chown the directory structure that is being changed by the script or use a method to execute shell commands as another user...
OR you could do something like.... build a mini secure webpage that is only accessible from SSL/443. All it would have is a single button. You click the button it executes your original script as root and returns the output to the mini script for display in the browser.