changing unix password via www python script
Sean Reifschneider
jafo-pythonlist at tummy.com
Sun Jan 21 02:28:56 EST 2001
On Sat, Jan 13, 2001 at 06:04:36PM +1100, Andrew MacIntyre wrote:
>On Fri, 12 Jan 2001, Vesemir wrote:
>> How to change unix account password by python script?
>> I want to write www script, controled by form.
>
>Its clumsy and trouble prone, but what I did was use one of the expect
>modules (PyExpect?- can't remember for sure), and telnetted to localhost
It depends on what platform, but on Linux you can simply feed the data
to "passwd --stdin username". At one point (before the --stdin patch
was available) I hacked the source code to "passwd" so that I could
do something like: "echo user:oldpass:newpass | pwweb" and it would do
all the appropriate checking and return a success or failure string.
Sean
--
I keep just enough vi knowledge in my head so that I can edit a Makefile
and build Emacs. -- Tony Foiani, 1999
Sean Reifschneider, Inimitably Superfluous <jafo at tummy.com>
tummy.com - Linux Consulting since 1995. Qmail, KRUD, Firewalls, Python
More information about the Python-list
mailing list