Woger's picture

Hi,

I've been trying to get the fileserver to work for over 3 days now. I've tried many settings, howto's, forums and AI's but nothing helps.

I have 2 users and 2 groups. User admin is member of samba-rw and user archief is member of samba-ro. The share is chowned root:samba-rw and chmodded 2775 for directories and 644 for files.

If I don't use the setting: force group = samba-rw everything works and I can log on, but I can't write as user admin. If I enable force group = samba-rw I can't even log on and I get an error NT_STATUS_NO_SUCH_GROUP

smbconf:

[global]
        add group script = /usr/sbin/groupadd '%g'
        add user script = /usr/sbin/useradd -m '%u' -g users -G users
        add user to group script = /usr/sbin/usermod -G '%g' '%u'
        delete group script = /usr/sbin/groupdel '%g'
        delete user script = /usr/sbin/userdel -r '%u'
        dns proxy = No
        domain master = Yes
        log file = /var/log/samba/samba.log
        map to guest = Bad User
        max log size = 1000
        obey pam restrictions = Yes
        os level = 65
        pam password change = Yes
        panic action = /usr/share/samba/panic-action %d
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        passwd program = /usr/bin/passwd %u
        preferred master = Yes
        security = USER
        server min protocol = SMB2
        server string = TurnKey FileServer
        unix password sync = Yes
        winbind use default domain = Yes
        wins support = Yes
        recycle:touch = yes
        recycle:keeptree = yes
        recycle:exclude_dir = tmp quarantine
        recycle:versions = yes
        idmap config * : backend = tdb
        admin users = root
        vfs objects = recycle

[Archief]
        create mask = 0664
        directory mask = 0775
        inherit permissions = Yes
        path = /mnt/Archief_Schijf/Archief
        read list = archief @samba-ro
        read only = No
        valid users = admin @samba-rw archief @samba-ro
        write list = admin @samba-rw

I am completely stuck now. My next step is to completely remove fileserver and try another package. So I hope someone have some clues.

thanks,
Roger

Forum: 
Jeremy Davis's picture

Hi Roger

Unfortunately, I haven't used Windows for many years so have zero need to use Samba, So I have very little relevant samba experience or knowledge. So I'm not sure how much help I can provide. OTOH I am very familiar with Linux in general, particularly Debian; and as you would expect, intimate knowledge of TurnKey.

If you haven't already, I suggest that you have a read through the smb.conf man page. Man pages can be a little dense and may not provide anything that you haven't already seen, but may provide some value? The man page is a source of information directly relevant to the software and specific version. The Debian samba man page is provided by the upstream samba developers.

Given what you've written, you've likely already come across it, but the samba wiki is the canonical samba info resource and is provided by the samba developers. Again it may not directly address your specific problems, but may assist.

IMO another thing worth checking is that your config is completely valid. I know that sometimes samba will "work" with some invalid config, but won't actually do what you expect. Samba provide a tool called "testparm" to validate samba config so that might be worth a try? Again I'm unfamiliar with the actual usage of testparm, but I expect that the testparm man page would be a good place to start. FYI it is a part of the Debian samba package so you shouldn't need to install anything additional.

Arch Linux's Samba wiki page is likely another useful general reference. IMO the Arch Linux wiki is second to none when it comes to useful info and almost always has valuable information. Note that TurnKey is based on Debian, so the samba install procedure and notes about firewall etc won't be relevant. But Samba is Samba, so the commands and config info will be relevant. The only thing to keep in mind is that Arch is a "bleeding edge" Linux distro (focused on latest software rather than server stability), so the Arch wiki is likely directly relevant to the latest "stalbe release" of Samba; which will be newer than the default version in TurnKey/Debian.

Regarding the Samba version in TurnKey v18.x (Debian 12/Bookworm), the default pre-installed version is v4.17.12. Again it's likely not directly relevant to your problem, but there is a newer version in "bookworm-backports"; v4.22.2. That is the current stable Samba release so should directy match samba specific info in the Arch wiki. Once Debian backports is enabled it should be straight forward to install the newer version via apt.

Another thing that may not be directly relevant to your issue is filesystem permission set up. AFAIU using ACLs for filesystem permissions is considered a superior choice for use with samba. They provide much more granular control and allow a permissions model much closer to MS filesystem. TBH I'm not sure how relevant they may be to your specific problem and may be a side track. But may be worth consideration? You will need to install the acl package to configure them. You didn't note what platform you are running our fileserver app on, but using ACLs within an LXC container probably won't work OOTB. You will likely need to make changes on the host system. I can't speak to that in further detail, but you may need to research a bit to get that to work. Once installed and configured, ACLs should "just work" in a "proper" VM or bare metal install. I can't vouch for them specifically, but here are some ACL resources that should be relevant:

And when all else fails, posting on the Samba mailing list might be worth a try? The specific list to post on is the general samba list. If you do post there, be sure to note the version of Samba you are using and that the core OS is Debian 12/Bookworm (assuming you are using the v18.x TurnKey Fileserver).

Sorry I can't provide any specific guidance or suggestion specific to your problem, but hopefully some of my post may be of value.

One last thing to note in response to your comment "My next step is to completely remove fileserver and try another package." If you do try samba on some other 'nix OS and have better luck, please post back and share the OS and the working samba config. Having said that, unless the problem as actually a bug in the specific samba version installed, I would be surprised if you have a different experience with anything other than Windows itself. I'm not aware of any other Linux software that supports windows fileshares other than samba. FYI a number of the core Samba developers are directly involved in packaging samba for Debian - including the Samba lead dev - Andrew Bartlett. So I very much doubt that beyond a version specific bug and/or config that you will have a different experience.

Good luck with it and please post back and let us know how you go regardless.

Add new comment