I want to create and assign a password for a user in Linux, but it gives an error:
New password: Retype new password: Sorry, passwords do not match
Here is the script (executing with root):
from os import system
system('useradd user')
system('echo -e "pass\npass\n" | passwd user')