I want to make the samba password automatically generated, but this command does not work:
echo "passwd"|smbpasswd -a -s $user
It shows this error:
Mismatch - the password has not changed. Failed to get new password.
Could you offer any opportunity to make my script automatic?
You need to repeat the password "for confirmation", so to speak, for example,
printf "passwd\npasswd\n" | smbpasswd -a -s $user
must work.