CentOS 7 SMB server – Other Computer Cannot Connect To New Shares

How do I get the SMB server to work on CentOS 7 when sharing a folder on another volume?

I have an up-to-date CentOS 7 computer and install smb with yum.

I added a share:

[LowSideScratch]
    path = /Volumes/K7_PDISK1/Shared/LowSideScratch
    available = yes
    browsable = yes
    writable = yes
    guest ok = yes
    read only = no
    public = yes
    valid users = chrisadmin
    write list = *
    create mode = 0666
    directory mode = 0777
    inherit acls = yes

(It has a lot of fluff, I know, but it didn’t used to; I’ve been trying to make it work).

I tried connecting to this server both from OS X and Windows 10. Both devices can access the default home share while authenticated as me (so my smbpasswd is correctly set up) but when they mount the LowSideScratch they can’t see the test.txt file in there nor can they write any file to it.

I’m at a complete loss. I’ve spent an hour now searching and trying different combinations of settings and I just can’t get it to work.

Some useful information:

[chrisadmin@k7-local ~]$ mount | grep Volumes
/dev/sda1 on /Volumes/K7_PDISK1 type ext4 (rw,nosuid,nodev,relatime,seclabel,data=ordered)
[chrisadmin@k7-local ~]$ ls -la /Volumes/
total 4
drwxr-xr-x.  3 root       root         23 Aug 10  2017 .
dr-xr-xr-x. 19 root       root        271 Aug 10  2017 ..
drwxrwxrwx.  6 chrisadmin chrisadmin 4096 Aug 10  2017 K7_PDISK1
[chrisadmin@k7-local ~]$ ls -la /Volumes/K7_PDISK1/
total 23585972
drwxrwxrwx. 6 chrisadmin chrisadmin        4096 Aug 10  2017 .
drwxr-xr-x. 3 root       root                23 Aug 10  2017 ..
drwx------. 2 root       root             16384 May 31 04:12 lost+found
drwxrwxr-x. 3 chrisadmin chrisadmin        4096 Aug 10  2017 Shared
<other items redacted>
[chrisadmin@k7-local ~]$ ls -la /Volumes/K7_PDISK1/Shared/
total 12
drwxrwxr-x. 3 chrisadmin chrisadmin 4096 Aug 10  2017 .
drwxrwxrwx. 6 chrisadmin chrisadmin 4096 Aug 10  2017 ..
drwxrwxrwx. 2 chrisadmin chrisadmin 4096 Aug 10  2017 LowSideScratch
[chrisadmin@k7-local ~]$ ls -la /Volumes/K7_PDISK1/Shared/LowSideScratch/
total 12
drwxrwxrwx. 2 chrisadmin chrisadmin 4096 Aug 10  2017 .
drwxrwxr-x. 3 chrisadmin chrisadmin 4096 Aug 10  2017 ..
-rw-r--r--. 1 root       root          3 Aug 10  2017 test.txt
[chrisadmin@k7-local ~]$ cat /etc/fstab | grep Volumes
LABEL=K7_PDISK1 /Volumes/K7_PDISK1 auto nosuid,nodev,nofail,x-gvfs-show 0 0

Edit:

Apparently I can’t read/write from the default shares either, but I can see a top-level folder listing…

Answer

Apparently the problem was with SELinux – the security subsystem that does filesystem protection.

The SE Linux Troubleshooter lists out all the things it learned and steps to enable it, which is helpful. However, I never did successfully make it enable access for the entirety of certain directories, so I had to make it enable RW access for smbd everywhere (and trust smbd to not have a bug to expose everything else); I’m not sure how I feel about this.

Then again, I was going to enable smbd without SELinux, so….

Attribution
Source : Link , Question Author : iAdjunct , Answer Author : iAdjunct

Leave a Comment