adding samba passwds

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


[Suresh Kumar. R <sudhas at md3.vsnl.net.in>]
> 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
newusers):

  #!/bin/sh
  PATH=/usr/local/samba/bin:/usr/bin
  while IFS=: read u p ignored; do
    echo -n "Adding user $u to smbpasswd..."
    { echo "$p"; echo "$p"; } | smbpasswd -s -a "$u" >&- &&
    echo "done."
  done

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

Peter


More information about the samba mailing list