How do I get my python program to get the root password ?

Grant Edwards grante at visi.com
Sat Jan 24 00:42:34 EST 2009


On 2009-01-24, Aahz <aahz at pythoncraft.com> wrote:
> In article <mailman.7854.1232759225.3487.python-list at python.org>,
> Linuxguy123  <linuxguy123 at gmail.com> wrote:
>>
>>I want to make a python program that I can run as a normal user that
>>changes the permission on some device files.  It will need to ask me for
>>the root password and then run chown as root in order to do this. 
>>
>>How do I accomplish this (easily) ?
>
> The easiest -- really -- is to just make it a root script and run it with
> sudo.  If you're on Ubuntu, that's pretty much the only option (without
> resorting to complicated ways of running sudo) -- the standard Ubuntu
> setup doesn't have a root password.

Though it's easy enough to set the root password, it's not
really the "Ubuntu way"...

-- 
Grant




More information about the Python-list mailing list