#3991 Samba create user bug


Similar to Bug 3006945, the Samba module does not create a new samba user properly.
Samba is setup as default, using tdbsam for password backend.

Based on configuration file, this is not a pdbedit issue as smbpasswd is defined as the password utility.
It seems that the module is not using the -a flag for adding new users with the command "smbpasswd".
However, the module does manually edit the file "smbpasswd" to add the user and therefore subsequently believe the user was added. This error becomes obvious when user has problem accessing shares and/or trying to set a password will result in access violation error. Using command line to issue the smbpasswd command reveals that user was not added to the database.

Using the bundled SWAT module to add the user will solve the problem and subsequently Webmin will be able to change the password.


  • Jamie Cameron

    Jamie Cameron - 2011-09-21

    Actually Webmin does use the smbpasswd command with the -a flag to create a user... it uses a command like :

    smbpasswd -s /etc/smb.conf -a username

    Does that work if run manually? The smb.conf path is taken from the Module Config page of the Samba module..

  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2011-09-23

    1. Webmin -> System -> Users and Groups: Create new user "tester" with normal login and password
    2. Webmin -> Samba Windows File Sharing -> Edit Samba users and passwords -> click user "tester".
    3. Enter new password and click save -> Access Violation Error

    My CentOS 6.0 smb.conf file is not at /etc/smb.conf but the webmin Samba Config page shows the correct path /etc/samba/smb.conf

    In any case manually from CLI
    # smbpasswd -s /etc/samba/smb.conf -a tester
    Indicates an error with the command, looking at the options, it should be -c to specify a conf file while -s is to use stdin for password prompt.

    This command line works with the -s option
    # (echo "testpassword"; echo "testpassword") | smbpasswd -as tester
    Added user tester.

    Checking in webmin, I can now change the password for this user.

    Looking into samba-lib.pl it seems to be the case, the wrong option flag -s is used to indicate the smb.conf file location and the password does not appear (I don't do python so might be mistaken) to be passed to the smbpasswd script/program.

    Last edit: Anonymous 2014-10-29
  • Jamie Cameron

    Jamie Cameron - 2011-09-23

    Ok, that explains it .. I will update Webmin to use the correct smbpasswd flag in the 1.580 release.

  • Jamie Cameron

    Jamie Cameron - 2011-09-23
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks