Solved FreeBSD shares with Samba4 - cant access from windows 10

Lars Skogstad

Active Member

Reaction score: 42
Messages: 107

Hi.

Searched around beforing posting this and I can't solve this problem.

I've done a fresh installation of FreeBSD 12.1 with Samba 4 for network shares.
(Imported pool from my earlier FreeNAS server which is located at /tank/public )

Anyway, So I installed Samba, made a config at: /usr/local/etc/smb4.conf :

Code:
[global]
    workgroup = WORKGROUP
    realm = mygroup.local
    netbios name = NAS

[movies]
    path = /tank/public/movies
    public = no
    writable = yes
    printable = no
    guest ok = no
    valid users = n3c

[series]
    path = /tank/public/series
    public = no
    writable = yes
    printable = no
    guest ok = no

Then did the:
pdbedit -a -u n3c

Didn't find anything on the share, just some .txt files within the folders.
Did a chown to give rights to the folders to me.
network_nas.png

First as n3c:wheel , didnt find anything in the network share (from windows10)

Then did a chown for n3c:n3c as owner.

Both of them made me see the the folders but I still can not access the folders from my Windows 10 machine.

Anyone with some suggestions?

Would it be better to make another use for it instead of my user with wheel? Just make a user/group: winshare/winshare ?

- Lars
 
OP
Lars Skogstad

Lars Skogstad

Active Member

Reaction score: 42
Messages: 107

Okay, So its probably some user rights.

Made a new share inside smb4.conf , shared a test folder for my users home folder : /home/n3c/testeda
and made a test.txt inside it.

Shared it, and it showed up with no problems, full user rights etc.
 
OP
Lars Skogstad

Lars Skogstad

Active Member

Reaction score: 42
Messages: 107

So I cannot change chmod on the /tank/public/movies -or- /tank/public/series ,

Is it because the user owner is wrong from the earlier FreeNAS system? Mismatch in UID/GID?

ssd and tank , are the pools from the earlier freenas system.

But within the ssd pool its no problem to create folders, files or share within Samba, works like a charm in Windows 10..


Im a bit stuck, anyone who could help out?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,675
Messages: 39,278

Your unix permissions are removed on the movies and series folders. As the + indicates there's an ACL on it instead. Use getfacl(1) to see the ACL, use setfacl(1) to remove/edit that ACL. I'm pretty certain the ACL is what is preventing access.
 
OP
Lars Skogstad

Lars Skogstad

Active Member

Reaction score: 42
Messages: 107

SirDice: Okay yeah I found on article regarding it and thought it might have something to do with that. Im not familiar with the ACL.
FreeNAS was confusing me more than FreeBSD and it feels a bit limited in my opinion. Would rather just set up Samba etc. myself without the gui and several jails for each application.

Do you have any suggestions on where its good to mount just plan storage within my existing system? is just /tank okay or should it be mounted within a sub folder like /usr/local ?
 
OP
Lars Skogstad

Lars Skogstad

Active Member

Reaction score: 42
Messages: 107

Code:
root@freebsd:/ssd # getfacl /tank
# file: /tank
# owner: n3c
# group: wheel
            owner@:rwxp--aARWcCos:-------:allow
            group@:r-x---a-R-c--s:-------:allow
         everyone@:r-x---a-R-c--s:-------:allow
root@freebsd:/ssd # getfacl /ssd
# file: /ssd
# owner: root
# group: wheel
            owner@:rwxp--aARWcCos:-------:allow
            group@:r-x---a-R-c--s:-------:allow
         everyone@:r-x---a-R-c--s:-------:allow
 
OP
Lars Skogstad

Lars Skogstad

Active Member

Reaction score: 42
Messages: 107

Could it help running a

find tank/ | setfacl -b
find ssd/ | setfacl -b

?
 
OP
Lars Skogstad

Lars Skogstad

Active Member

Reaction score: 42
Messages: 107

SirDice: Thank you very much! After fiddling around I did a setfacl -b on all folders, chown to root:wheel on all folders+subfolders , did a chmod 755 to all folders within it.

I also had a typo in samba "writable" changed to "writeable". Did a restart of samba server and now it works perfectly.

But it was like you said the acl permission. Now I could chmod whatever I wanted.

Thanks again :) I appreciate your help as always!
 
Top