Running CGI as root

Dpk dpk@egr.msu.edu
Wed, 29 Mar 2000 11:33:33 -0500


On Wed, Mar 29, 2000 at 11:20:41AM -0500, Benjamin Minshall wrote:

   
   Hi,
   
   I have written a simple CGI script that requires root permission to
   restart some daemons remotely; however, I can't get my script to
   run as root.  The web server is running as nobody and the script
   permissions are -rws--x--x.  Is there something special I need to
   do to get the script to run as root?

Make sure it is owned by root, but you should probably use a C-wrapper
that executes your script.  You will then need to:

  chown root.root wrapper
  chmod 4555 wrapper

Dennis Kelly                    email: dpk@egr.msu.edu
Network Administrator           phone: 353-4844
College of Engineering          pager: 232-8117
Michigan State University