Running scripts as OS user other than apache/nobody
am 20.08.2009 04:53:21 von Dan HorneThis is a multi-part message in MIME format.
------_=_NextPart_001_01CA2141.616068FC
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi
=20
I have a need to run various CGI scripts as different OS users, perhaps
by Apache directory or via Apache virtual hosts. This isn't for security
reasons, but because we need to interact with different OS environments
via a web interface, and each environment will require a different OS
user. I should point out that this is on a departmental, low volume
server. Only our team has access to the server - via the web interface
or via ssh. We're using Apache on Redhat 5.3. Due to our support
contract, we must use the vendor's HTTP server rather than compile from
source.
=20
The solution I tried used suexec. But it does things like sanitise the
environment, including variables I need like ORACLE_HOME and ORACLE_SID.
And since mod_perl is bundled with Redhat Apache, I figure that maybe it
would be possible to write an mp handler that does a similar job to
suexec but without all the security features I guess suexec includes for
shared hosts and public websites.
=20
So my next is - how do I do this? If I simply set my euid within the
handler, won't I effectively be changing the uid of the httpd process?
So could I save my uid, change it to when the CGI script is being
executed, and then change it back again? Advice appreciated.
=20
Thanks
=20
Dan
=20
=20
Attention:
This email together with any attachments is confidential.=20
If you are not the intended recipient please delete the
=20message and notify the sender. Any views or opinions=20
presented are solely those of the author and will not=20
necessarily reflect the views of Meridian Energy.
************** PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING **********=
***
------_=_NextPart_001_01CA2141.616068FC
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
>
a need to run=20
various CGI scripts as different OS users, perhaps by Apache directo=
ry or=20
via Apache virtual hosts. This isn't for security reasons, but because we=
=20need=20
to interact with different OS environments via a web interface, and each =
environment will require a different OS user. I should point out that thi=
s is on=20
a departmental, low volume server. Only our team has access to the server=
=20- via=20
the web interface or via ssh. We're using Apache on Redhat 5.3. Due to ou=
r=20
support contract, we must use the vendor's HTTP server rather than compil=
e from=20
source.
ution I tried=20
used suexec. But it does things like sanitise the environment, including =
variables I need like ORACLE_HOME and ORACLE_SID. And since mod_perl is b=
undled=20
with Redhat Apache, I figure that maybe it would be possible to write an =
mp=20
handler that does a similar job to suexec but without all the security fe=
atures=20
I guess suexec includes for shared hosts and public=20
websites.
ext is - how=20
do I do this? If I simply set my euid within the handler, won't I effecti=
vely be=20
changing the uid of the httpd process? So could I save my uid, change it =
to when=20
the CGI script is being executed, and then change it back again? Advice=20
appreciated.
confidential. If you are not the intended recipient please delete the mes=
sage=20
and notify the sender. Any views or opinions presented are solely those o=
f the=20
author and will not necessarily reflect the views of Meridian Energy.=20
*******=20
PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING ************* >
------_=_NextPart_001_01CA2141.616068FC--