开发者

echo smbpasswd by --stdin doesn't work

开发者 https://www.devze.com 2023-01-08 11:00 出处:网络
I want to m开发者_StackOverflowake creating a samba password automated but this command doesn\'t work:

I want to m开发者_StackOverflowake 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.


The printf solution above works perfect, but also echo -e works fine

echo -e "yourpass\nyourpass\n" |smbpasswd -a -s youruser
0

精彩评论

暂无评论...
验证码 换一张
取 消