[Zope3-Users] execute script from as root user

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Jun 7 15:33:48 EDT 2006


On Tuesday 06 June 2006 23:49, Leticia Larrosa wrote:
> I want generate a shell script and run it as root in the local system from
> a zope3 application.
>
> For example I want to save a file with the following content:
>
> #! /bin/sh
> ls
>
> I want to open this file and run the content as the root user.
>
> Any idea?

Use Python popen or popen3. It allows you to execute shell comands. As the 
other response suggests, you can use "sudo" or "su" to become root.

Having said that, I caution you that this could open a huge security hole.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list