Page 1 of 1

exec() function - which user on linux

Posted: Tue Dec 28, 2004 7:06 pm
by bluesman333
which user, if on linux system, executes a command when using the exec() function?

i'm assuming it's the user assigned to apache.

if so. is it possible to run root commands with exec()?

Posted: Tue Dec 28, 2004 7:36 pm
by m3rajk
it runs as whatever the user is that does the apache/php daemon.... normally nobody


i would assume you can always have exec run a series of commands.....

exec('su \n<pass>....');

or something like that, but i'm not sure

Posted: Tue Dec 28, 2004 9:40 pm
by timvw
you never want to run commands as root.. (or run apache as root)

options are:
- setup suEXEC for apache
- setup some ACL and allow the webserver user to perform whatever task
- play with the suid and sgid bits...