Good day everyone, I was wondering how I could go about allowing php's exec to execute a certain binary? For example, If i try and run "whoami" I get: Code: [Wed Aug 27 12:51:46 2014] [error] [client x.x.x.x] sh: whoami: command not found In the error log. Using something like Code: <?php echo exec("whoami"); ?> If I wanted to allow whoami to be ran, what would I need to do? Many thanks
As far as I know, you cant restrict which commands exec can run. when you activate exec, then all commands that are accessible for the user of the website can be run with exec.
Hi Till, Thank you for that. I thought that might be the case. How would I allow a command to be ran as that user, in that case? Say I wanted to allow a user to run whoami?
You should use the full-path. Apache uses /usr/bin. Maybe whoami is located in a different directory.