adding samba passwds

Peter Samuelson peter at
Wed Jun 28 09:19:01 GMT 2000

[Suresh Kumar. R <sudhas at>]
> At present windows login for users is enabled by the sysadm executing
> the smbpasswd command as the user, after creating the account.
> But this is a very cumbersome process when we create around 500 users
> at one go. Is there any way this can be overcome ?

According to `man newusers', it takes a rather simple input format.
Try feeding that same input to the following script (*after* you run

  while IFS=: read u p ignored; do
    echo -n "Adding user $u to smbpasswd..."
    { echo "$p"; echo "$p"; } | smbpasswd -s -a "$u" >&- &&
    echo "done."

Now you know why all Unix admins need to know shell scripting.  It just
saves *so* much time.


More information about the samba mailing list