I have been reading all over the web for a decent method on how to run a script as a different user, but I'm totally lost now ...
- Apache server (running as user apache) with php webpage > ok
- php webpage has to launch bash script (bash script has to be executed as different userX:groupY) > not ok
- I'm on red hat 6.4
I understand that I should get something like suexec or suphp and set the suuid bit on the script.
> However this raises my first question, at one point in time I was able to launch the script by suexec, but it would only execute as root.
I never managed to get it working under the userX:groupY
Is this normal?
> if somebody could help me out with this and also with the php part, cause my php knowledge is a bit light it seems, I would be very happy
Server version: Apache/2.2.15 (Unix)
Server built: Dec 5 2012 04:03:05
-rwsr-xr-x 1 userX groupY 4807 Mar 5 14:51 runscript
-rw-r--r-- 1 userX groupY 151 Mar 5 14:51 runscript.c
-rwsr-xr-x 1 userX groupY 24 Mar 4 16:12 script.sh
-rw-r--r-- 1 root root 650 Apr 5 11:35 test.php