Solved Samba 4.1 Shares access

Hi all,

I made this work 2 days ago but then I had to reinstall and create a new 6 TB ZFS mirror for my NAS backup. But Samba refuses to let me connect to the share (stupid I did not take notes on what I did previously). FreeBSD 10.1.

I can see shares on all other machines and they work fine, I can create a public share on my machine and access it but I want one user to access the backup share which in on the mirrored drives (\backups). That user will responsible for the backups from the NAS drive, but it refused to let me in.

Here is my smb.conf, really simple:
Code:
********************************************************
# Global parameters
[global]
  workgroup = MOONBASE
  realm = MOONBASE
  netbios name = MOONWALKER
  server role = standalone server
  passdb backend = samba_dsdb
  dns forwarder = 192.168.1.1
  nsupdate command = /usr/local/bin/samba_nsupdate -g
  security = user


[wdbackups]
  write list = daria
  path = /backups/mycloudbackups
  writeable = yes
  valid users = daria,@daria
  create mode = 775
  comment = WDMycloud backups
  directory mode = 775
  force group = daria

[Public]
  comment = Public
  path = /Public
  public = yes
  guest ok = yes

********************************************************
I added the user daria (who is a FreeBSD user and also a member of the "wheel" group) via pdbedit and all looks fine

Here is the directory which 2x 3TB ZFS simple mirror.
Code:
drwxr-x--x  3 root  wheel  uarch  3 Mar 17 22:32 backups/
and the backup directory is inside
Code:
drwxr-x--x  3 root  wheel  uarch  3 Mar 17 22:32 ./
drwxr-xr-x  20 root  wheel  uarch 27 Mar 17 21:41 ../
drwxrwx---  2 root  daria  uarch  2 Mar 17 22:32 mycloudbackups/
I tried chown for daria, and other stuff nothing seems to work (but it did 2 days ago :) ).

Using smbclient here is the output (all on the same workgroup):
Code:
$ smbclient \\\\moonwalker\\wdbackups -U daria
Enter daria's password:
session setup failed: NT_STATUS_UNSUCCESSFUL
Any help is much appreciated...
 
Last edited by a moderator:
Now it works. I changed passdb backend = samba_dsdb to smbpasswd and added the user to it. I thought I can use pdbedit?!!! what I use to add user with samba_dsdb? I tried pdbedit but it didn't work.

Another note (since I am here :) ). I have NFS working, thanks to the very good handbook. I want the same setup as above but how do I make sure that only daria can read and write to that share? Permissions still confuse me.
 
Some small thoughts to add. I'm not familiar with the samba_dsdb option but when I set up Samba 4.1, I opted to use the PAM_SMBPASS option so normal users on the systems get their password updated upon SSH login in or using passwd. I haven't had to touch smbpasswd(8) to set passwords. See Thread 49581.
 
...
I added the user daria (who is a FreeBSD user and also a member of the "wheel" group) via pdbedit and all looks fine
...

Good deal. I think the PAM_SMBPASS makes sense given your comment above. If you had some other reasons in mind why you started with the samba_dsdb backend then post it up. It wouldn't hurt to bounce ideas around and make sense if that makes more sense for your requirement.
 
Yeah, sorry I should have comeback. It was a confusion on my part :(
what I actually wanted is "tdbsam" the trivial database (for small 1-250 users) as "smbpasswd" is for backward compatibility. in Samba 4.1 it is the recommended backend.

I consulted the FreeBSD handbook (should have done it first time :mad:) I have changed back to "tdbsam" and I had to add the user using pdbedit. All working now. :rolleyes:
 
I got it now. I left it unset so it appears the defaults were used. I just look on my NAS and everything in /var/db/samba4 is a .tdb file. Thanks!
 
Back
Top