Search code examples
linuxsamba

Samba Share whithout writing rights


I see my Samba shares and folders/files in the network (Windows and Linux clients) but I can't write or create files in it. On the Linux is the Folder 777? smb.conf is read only = no and writable = yes ...thx for any help

smb.conf (testparm):

[global]
    workgroup = workgroup
    netbios name = xyz
    server string = Samba Server Version %v
    map to guest = Bad User
    passdb backend = tdbsam
    username map = /etc/samba/smbusers
    max log size = 50
    hosts allow = 127., XXX.YYY.ZZZ.WWW
    cups options = raw

 [Test1]
    path = /xyz/Test1
    valid users = ZZZZ
    read only = No
    create mask = 0777
    directory mask = 0777

ls -l:

drwxrwxrwx 3 ZZZZ smbusers 4096 14. Mär 13:55 Test1

Solution

  • I had to change the "Security Enhanced Linux Policy for the smbd processes"

    http://linux.die.net/man/8/samba_selinux

    If you want to allow samba to share any file/directory read/write, you must turn on the samba_export_all_rw boolean.

    setsebool -P samba_export_all_rw 1
    

    If you like to check your status:

    getsebool -a | grep samba