Superuser authority (again)
burkhard.nospam.kloss at kbcfp.com
Tue Feb 11 15:31:37 CET 2003
Have a look at sudo - man sudo - I think that will do the trick for you.
"Wouter van Marle" <wouterm at spammers-unite-here.com> wrote in message
news:b29upv$7du4 at imsp212.netvigator.com...
> Hi all.
> I have a similar problem as outlined by Tim Daneliuk in the thread a few
> weeks ago - I need to perform some superuser action. I was already so far
> (before reading the thread) to not want the script to know the password -
> the user will have to give this password. This also because the script
> have to be distributed.
> Background: I have a fax application, and want it to interact with the
> mgetty and sendfax config files. Also I want to write an automated
> installer. Reading those config files of course works fine, now I want the
> program to also be able to write to these files. That requires root
> So what I am thinking of: when the user has changed some setting and wants
> to save those files, he will have to give the root password.
> Basically all the script has to do as root, is invoke a copy command, to
> copy the updated config file from the user-writable temporary directory,
> the /etc/mgetty+sendfax directory.
> Same for the installation: files can first be stored in the temp
> and then copied to the final destination.
> How to do this 'copy with root permissions'? And related: setting the
> correct ownership of the files (with root permissions again).
> Secondly I would like to know what you think about having the user give
> password for every single action (copying and chown-ing of a batch
> as a single action), or once per session?
More information about the Python-list