Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Running samba 3.5 on Red Hat Enterprise 6.1 I'm having issues sharing two folders. Here is the output of testparm:

[global]
    workgroup = DOMAINNAME
    server string = Samba Server Version %v
    interfaces = lo, eth1
    bind interfaces only = Yes
    map to guest = Bad User
    log file = /var/log/samba/log.%m
    max log size = 50
    idmap uid = 16777216-33554431
    idmap gid = 16777216-33554431
    hosts allow = 10.50.183.48, 10.50.184.41, 10.50.184.199, 10.50.183.160, 127.0.0.1
    hosts deny = 0.0.0.0/0
    cups options = raw

[test]
    comment = test folder
    path = /usr/local/samba
    valid users = claudio
    write list = claudio
    force user = claudio
    read only = No
    create mask = 0775
    directory mask = 0775

[test2]
    comment = another test
    path = /home/claudio/tst
    valid users = claudio
    write list = claudio
    force user = claudio
    read only = No
    create mask = 0775

From the Windows XP machine I'm connecting from I'm able to read test but not write, while for test2 I can't even access the folder (though I can see it listed).

ls -l /usr/local
...
drwxrwxrwx. 2 claudio claudio 4096 Dec  3 10:39 samba
...

ls -l /user/local/samba
total 32
-rwxrwxrwx. 1 claudio claudio    9 Nov 29 16:26 asd.txt
-rwxrwxrwx. 1 claudio claudio  728 Dec  3 10:16 out.txt
...

ls -l /home/claudio/
...
drwxrwxr-x.  2 claudio claudio       4096 Dec  3 09:57 tst
...

ls -l /home/claudio/tst
total 4
-rw-rw-r--. 1 claudio claudio 4 Dec  3 09:57 asd.txt

Any suggestion?

share|improve this question
1  
Interestingly, I had to do both read only = no and writeable = yes, even though they appear synonymous. But I deleted the answer since you didn't think it would help. But I was doing this last night and thought the same thing - which in my case that fixed it. –  nerdwaller Dec 3 '12 at 15:21

1 Answer 1

Red Hat Enterprise comes with SELinux enabled by default, which provides an implementation of the mandatory access control mechanism (as you can read from the guide).

That means shared files/folders need to be labeled with the proper type in order to allow smbd to share them correctly (you can check it adding the option Z to the ls command). This is achieved through the command

chcon -t samba_share_t /path

which allow to write on the share (add the option -R to flag recursively).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.