note 29140 added to function.shell-exec
| From: | php dot net at irradour dot co dot uk | Date: | Tue, 04 Feb 2003 11:46:23 +0000 |
| Subject: | note 29140 added to function.shell-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43376@lists.php.net to get a copy of this message | ||
As none of the shell commands allow you to su to root (they cannot open the stream to put in the
password for su - tested Redhat Linux 7.1) the only way I found to su to another user to run a
command is - assuming apache is your apache user:
login as root.
chown root:apache myShellScript.sh
chmod 777 myShellScript.sh
chmod +s myShellScript.sh
now when the apache user runs the command, it should automatically setuid to root as it is run, I
think.
--
http://www.php.net/manual/en/function.shell-exec.php
http://master.php.net/manage/user-notes.php?action=edit+29140
http://master.php.net/manage/user-notes.php?action=delete+29140
http://master.php.net/manage/user-notes.php?action=reject+29140