Samba SUSE 9.3 users

Posted on 2006-04-12
Last Modified: 2012-08-14
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.

Question by:hautine
    LVL 9

    Accepted Solution

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

    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

    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 :)
    LVL 3

    Assisted Solution

    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:
    This link could be useful as well:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Hello I read in a discussion about a person who configured a very simple mirror RAID with two hard drives; the system and data were on the same partition. He asked how to repair the system as it was not booting up anymore. In his case running …
    Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now