> I've got a php form, that gathers certain information, and 
 > then passes that info on to a couple of shell scripts to 
 > move files around, create links, import data into some mysql 
 > databases via sql files, etc.
 > 
 > The two shell scripts work fine when I'm logged in as root 
 > via telnet.  The consistently don't work from my website.  I 
 > know it must be a permissions problem, but I'm still a 
 > relative newbie relative to linux/permissions, and would 
 > appreciate any guidance in resolving it.

Yep, it's a permissions problem.  For starters, when the scripts are run
through your web site they will run as the user that your web server
runs as (nobody or apache or some such) and that user will typically
have limited permission to do much of anything.

If you're doing stuff that is normally only accessible to root then
you'll have problems.  For starters, the SUID bit usually doesn't work
on shell scripts - this is a security thing.

I've not really considered how to get around this but you might look at
what Webmin does as it does plenty of 'root only' stuff from a web
browser.

Off hand, one solution might be to create the shell script from your web
page but then not try and execute it.  Then have a cron job (running as
root) that will examine the contents of a directory and run the scripts
accordingly.  I can think of a number of security problems with this so
you'd want to be very careful what you let people do in this
environment.

CYA, Dave




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to