Samba SUSE 9.3 users

How can i automatically create a large number (600) of samba users for my network running a SUSE 9.3. Presently i already have the users in a MYSQL database and i will be happy to use any other approach  approach to create all the user accounts automatically.

Thanks
hautineAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sda100Commented:
Hello hautine,

I'm not sure how to call upon MySQL from a command line, but if you could export the users to a text list, called users.txt - you run a script, something like this...

#!/bin/sh
#
for i in `cat users.txt`
   # create the linux user account
   # primary group smbusers, no home dir, no shell (change these options at your leisure)
   useradd -g smbusers -M -s /dev/null $i
   # add the samba user with no password
   smbpasswd -a -n $i
done

If you want to add a password, for each samba user, I'm not sure how to stick it on the command line - but I'm sure someone else mght be able to help.  Oh yeah, the script is untested!

Steve :)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RiDo78Commented:
You don't have to export / import users as Samba is able to use MySQL for authentication.

The following link is regarding free-bsd with samba & mysql, but it's also usable for Linux: http://www.freebsddiary.org/samba-pam.php
This link could be useful as well: http://lists.samba.org/archive/samba/2004-June/086936.html
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.