[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

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

Note:
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...

HJ





More information about the samba mailing list