SAMBA: Cannot share ntfs drives

Issues related to configuring your network
Post Reply
lawleagle
Posts: 2
Joined: 2018/02/16 21:10:42

SAMBA: Cannot share ntfs drives

Post by lawleagle » 2018/02/16 21:42:21

Code: Select all

$ pwd
/nas

$ ll
drwxrwxrwx. 1 root    root    8192 Feb 16 16:15 1
drwxrwxrwx. 1 root    root    4096 Feb 16 12:57 2
drwxrwxrwx. 1 root    root    8192 Feb 16 13:46 3
Folder names are actually '1', '2' and '3'.

Code: Select all

$ cat /etc/samba/smb.conf
[global]
        workgroup = WORKGROUP
        server string = Samba Server Version %v
        log file = /var/log/samba/log.%m
        max log size = 50
        security = user
        passdb backend = tdbsam
        load printers = yes
        cups options = raw

[homes]
        comment = Home Directories
        browseable = no
        writable = yes

[printers]
        comment = All Printers
        path = /var/spool/samba
        browseable = no
        guest ok = no
        writable = no
        printable = yes

[public]
        comment = Public Stuff
        path = /nas
        public = yes
        writable = no
        printable = no
        write list = +wheel
If I access my server from a windows machine, I can see the public share, I can access it, I can see that it has folders '1', '2' and '3', but I cannot access either of those folders. I get "You do not have permissions to access \\<server_ip>\public\1" if I try to access folder 1.

I can also create and access other folders & files in the public share. (Creating a fourth directory from the windows machine, besides those 3 can be done with no issues)

The three folders are mounts from 3 different ntfs partitions on 3 different hard drives. They are mounted in fstab like this:

Code: Select all

UUID=9048F57548F55B04   /nas/2                  ntfs    defaults        0 0 
UUID=6024BB8B24BB6328   /nas/1                  ntfs    defaults        0 0
UUID=523E79673E7944CF   /nas/3                  ntfs    defaults        0 0, fmask=0000
I tried everything I could find on the internet and this is what I have now. Can you help me solve the issue?

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: SAMBA: Cannot share ntfs drives

Post by hunter86_bg » 2018/02/17 06:17:55

try to mount that ntfs mount point while adding

Code: Select all

context=system_u:object_r:samba_share_t:s0
so SELINUX allow samba to get access.
Also don't forget to create the samba user's passwd with 'smbpasswd -a'

lawleagle
Posts: 2
Joined: 2018/02/16 21:10:42

Re: SAMBA: Cannot share ntfs drives

Post by lawleagle » 2018/02/17 08:59:48

Code: Select all

context=system_u:object_r:samba_share_t:s0
This bit did it! Thank you!

Post Reply