I want to make creating a samba password automated but this command doesn't work:
echo "passwd"|smbpasswd -a -s $user
It shows this error:
Mismatch - password unchanged. Unable to get new password.
Could you please suggest any option to make my script automated?
You need to repeat the password, "for confirmation" so to speak, so e.g.
printf "passwd\npasswd\n" | smbpasswd -a -s $user
should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With