Change password on Linux
Antonios Christofides
A.Christofides at itia.ntua.gr
Thu May 22 13:20:13 EDT 2003
Bo M. Maryniuck wrote:
> > Does anyone know how to change a Linux password using Python?
>
> 1. Tweak /etc/shadow if you're experienced Linux admin
> 2. os.popen() and passwd command
I don't think you can do it with os.popen(); passwd does not read the
password from stdin. You can do it with expect or pexpect. If you prefer
a standard module, you can use telnetlib to telnet localhost.
More information about the Python-list
mailing list