How do I add users using Python scripts on a Linux machine

Ramdas ramdaz at gmail.com
Tue Jan 2 01:42:35 EST 2007


Well,

I need to add users from a web interface for a web server, which runs
only Python. I need to add users, set quotas and in future even look at
managing ip tables to limit bandwidth.

I know os.system(), but this has to be done through a form entry
through a web interface.

Anyways thanks, do advise if there more pythonic solutions

Ramdas


Hari Sekhon wrote:
> That is shell scripting with a python layer on top. Is there a
> specific reason you have to use python? Why not just use shell, that's
> what it's designed for? Unless you have some complex maths/networking
> requirement or something on top.
>
> -h
>
> On 01/01/07, Daniel Klein <danielkleinad at gmail.com> wrote:
> > On 1 Jan 2007 11:33:42 -0800, "Ramdas" <ramdaz at gmail.com> wrote:
> >
> > >How do I add users using Python scripts on a Linux machine?
> > >
> > >Someone has a script?
> >
> > This should be as easy as something like:
> >
> > os.system("/usr/sbin/useradd -m -d /home/newuser -s /bin/ksh")
> >
> > Dan
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
> 
> 
> -- 
> Hari Sekhon




More information about the Python-list mailing list