Re: Execute command line as a different user
| From: | Matt Palermo | Date: | Tue, 01 Jul 2008 17:36:23 +0000 |
| Subject: | Re: Execute command line as a different user | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-276188@lists.php.net to get a copy of this message | ||
Okay, I'll have to look into that. I have very limited knowledge with shell scripts. You wouldn't have an example of one that can do what I need do you?
Thanks,
Matt
"Shawn McKenzie" <nospam@mckenzies.net> wrote in message news:52.60.06277.D1A6A684@pb1.pair.com...
Matt palermo wrote:My PHP is running as a user with limited rights. I'd like to execute a command line as a different user. I'm trying to delete a file and the PHP user doesn't have access to do this. I know the username and password for the admin user that has rights to delete a file. Is there a command I can use to make PHP run a delete command as the admin user? If so, how can I do this? Thanks, MattThere are several ways on *nix systems. I would probably write a shell script to do the deletions and setuid of the script to root or a user with rights to delete the files. Then just exec() the shell script. On winbloze you can use the runas command. -Shawn