[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] executing a root privileged cgi from a web page
- Subject: Re: [cobalt-users] executing a root privileged cgi from a web page
- From: "Brian Curtis" <admin@xxxxxxxxxxx>
- Date: Fri Sep 8 05:43:30 2000
- Organization: Pomfret Computer Technologies
> I have a simple minded cgi that needs to run as root to create user access
> permissions on my MySQL database. I have set it up as root.site# and then
> tried to execute it from a web form. As would be expected (seems to be my
> big problem - permissions, ownership etc) it gives a cgiwrap error saying
> user not privileged. How can I set this up so I can run it and the cgi can
> run as a root user ?
>
> cheers
>
> Jim Carey
May I ask why this CGI needs to be run with root permissions? Why not just
pass along the MySQL root username/pass in the cgi script and you should be
able to do whatever you need to with your MySQL databases, no? You do not
need to be root to perform MySQL maintenance, so I cannot understand why
this script *NEEDS* to be run as root.
Then again, I have no idea what the script in question does (ie. uses shell
MySQL commands), but there are many scripts out there that will do what you
want without having to be run with root permissions. Even if the script
does use MySQL shell commands, you can pass the root MySQL username/pass to
the shell command. You could even build your own little PHP or Perl script
to accomplish this (phpMyAdmin comes to mind as an example).
Executing any script with root permissions from a Web server is a security
hazard waiting to happen. Apache, by default, will not run as root unless
compiled with specific flags for security reasons.
--
BC