PHP: restrict script to one dir & and to one user
Hi,
1-Can I do su - userA in php? Cam I have php run the whole script as userA. 2-Can I make php to run from a certain directory? like chroot kind of things. Thanks. |
for #2, you may find these functions useful. You can chdir or chroot if you like.
For #1, that's more tricky. The php docs on exec have some suggestions...like this one: Code:
exec("echo 'apache' | /usr/bin/sudo -u mail -S /var/www/html/mailset.sh $name"); |
All times are GMT -5. The time now is 05:09 AM. |