Answer the question
In order to leave comments, you need to log in
How to put passwd password input in script?
In the python2.4 script, you need to set a password for the user usertest, let's say 123:
passwd = "123"
os.system(passwd usertest)
What the OS returns:
Changing password for usertest.
New password:
How to automatically substitute the password from the variable after the password prompt. (It is possible not from a variable, the main thing is that this process can be automated)
Answer the question
In order to leave comments, you need to log in
Pass password with passwd
parameters it not to a python questions, namely to passwd.
You can use other tools if they are in the system, for example:usermod --password PASSWORD USERNAME
the passwd command is special. And to accept the password as argument - does not want. Read the documentation
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question