I\'m having problems with changing a Linux user\'s password from python. I\'ve tried so many things, but I couldn\'t manage to solve the issue, here is the sample of things
The user you are running this as must have sudo permission to run the passwd command without a password.
passwd
>>> from subprocess import Popen >>> proc = Popen(['/usr/bin/sudo', '/usr/bin/passwd', 'test', '--stdin']) >>> proc.communicate('newpassword')