View Single Post
Old 04-30-2010, 10:46 AM  
BestXXXPorn
Confirmed User
 
BestXXXPorn's Avatar
 
Join Date: Jun 2009
Location: Asheville, NC
Posts: 2,277
Quote:
Originally Posted by camperjohn64 View Post
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.
__________________
ICQ: 258-202-811 | Email: eric{at}bestxxxporn.com

Last edited by BestXXXPorn; 04-30-2010 at 10:47 AM..
BestXXXPorn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote