|
Posted by Michael Vilain on June 12, 2008, 7:43 pm
Please log in for more thread options In article
> > In article
> >
> > > I am looking for a web interface for shell commands or shell scripts.
> > > Does anyone know of any exexisting php scripts which would solve this
> > > requirement?
> >
> > > PHP form accepts input from a user, then passes these as arguments to
> > > a configurable shell script or OS command. I would like for the
> > > output generated from the shell script/command shall be displayed in a
> > > new javascript window once the form is submitted. Optimally a user
> > > should not not be able to make the program run more than once from
> > > within the javascript window by reloading the window. program
> > > execution shall only be caused by submitting the original form.
> >
> > > -Inet
> >
> > Sounds like a homework assignment or something assigned in a beginner's
> > PHP class. Why not try to write you own version and when you get stuck,
> > post your problems to this group. You might learn something. Just a
> > thought.
> >
> > Alternately, you can look at some of stuff in various php libraries.
> > Lots of php developers from various countries have posted code to
> > various PHP sites (hint: it starts with "g" and ends with "e").
>
>
>
>
>
> Lots of the requirements were simplified down to make the request seem
> simplistic and consumable to a broader base. I assure you I'm long
> past homework problems. :)
>
> The root problem I'm trying to work around is I have a shell script
> that SSH's out to many servers using ssh key-pairs and performs
> various commands on each one (based on the input options/arguments)
> This needs to run as a specific user and needs for the environment
> from which it runs to be setup properly. when I setup a php based
> form to execute these commands, the shell it runs under is...limited
> at best. I have even tried sourcing the user's .profile as part of
> this routine, but that didn't' get me much farther. Is there a way to
> control what user the script will actually run as? Now back to my
> original questions... Are there any php utilities anyone knows of
> which can serve as an interface to a shell script or command line?
>
> -Inet
You can't control the UID of the process that's created by mod_php.
That will always be the web server's UID. This is a security feature.
The only way I've found around this restriction is a CGI tool called
CGIwrap:
http://cgiwrap.sourceforge.net/
When installed on a web server, it allows users to run a process under
any valid UNIX username. If you're using Windows, my apologies.
My ISP uses this as their secure way to run CGI scripts. If your web
host doesn't offer php as a command-line utility, all this is moot as
CGIwrap runs scripts in the context of a user's default shell.
The security for your krufty design is left as an exercise to the OP.
Good luck.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
[I filter all Goggle Groups posts, so any reply may be automatically by ignored]
|