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

Hari Sekhon hpsekhon at googlemail.com
Mon Jan 1 18:43:39 EST 2007


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