automating smbpasswd

Robert Dahlem Robert.Dahlem at
Sun Jul 25 08:43:00 GMT 1999

On Thu, 22 Jul 1999 19:31:54 +1000, S Lim wrote:

>I have about 1100 users on my system. I am setting up samba and I would
>like to use encrypted password. I would like to automate the creation of
>smbpasswd file. I have generated the smbpasswd with the
>script and now I have to add the passwords. I can not possibly type
>passwords for 1100 users twice so I would like to automate them. I can
>store users password file (temporarily) in normal text. I am writing a
>script to take this password (fork smbpasswd and take control of its STDIN
>from parent). It seems that smbpasswd ignores any input from the parent. 
>My questions are :
>- What is smbpasswd input?
>- Is there any script which does what I want to do?

Consider you have a file I_should_not_have_this in this format

	user1 password1
	user2 password2

then the script is:

cat I_should_not_have_this | while read line ; do
	set $line
	smbpasswd $1 $2


Robert.Dahlem at
Radio Bornheim - 2:2461/332 at fidonet +49-69-4930830  (ZyX, V34)
                 2:2461/326 at fidonet +49-69-94414444 (ISDN X.75)

More information about the samba mailing list