Calling shell scripts from PHP as other users
Hi all
Quick question regarding permissions under Linux. I want to call a shell script from a php page that will start an application on the machine.
To test this out, I've had a go executing 'uptime' from a php page and the results are returned to the browser, minus the number of users logged in.
I've had a read around and am still a little confused as to how this works with Linux file permissions. Presumeably if the Apache user has execute access to the script, it will run, but if the script itself fires off other applications do these also need to be executable by the Apache user?
Really after a little thought what I want to be able to do is to call a script to be executed as another user (NOT root but not www/apache either) from a php page. I think this is acceptable as the script in question takes no user input, it merely executes.
Can anyone walk me through the best way to do this ? I've had a read around and initally thought suExec might be what I was looking for, but the tutorial didn't really help with this particular problem.
TIA
Last edited by Thin; 11-30-2005 at 05:29 AM.
|