[Samba] smbpasswd password via stdin?

Hans J Haase hansjhaase at yahoo.de
Tue Apr 19 10:26:13 GMT 2005

Running under debian, using SAMBA V3.0.7, I use

(echo $PASS; echo $PASS) | smbpasswd -s -a $USER

smbpasswd requires a double typed in password, It took me a lot of minutes
to figure that difference between earlier version and the 3.0.7 out but now
it works.

In perl scripts I use this commandline like

#...somewhere in a for/while loop...
my $cmd = "(echo $pass; echo $pass) | smbpasswd -s -a $user";
my $retcode = `$cmd`;
#...next user...


More information about the samba mailing list