1

I have samba 4 running on Fedora 21.
I have a share set up:

[mediastorage]
    comment = MediaStorage
    path = /mnt/mediastorage
    public = yes
    writable = yes
    printable = no
    read only = no
    write list = rmasters
    create mask = 0775
    directory mask = 0775

I can connect to this share fine and add folders and files just fine. I have 2 existing folders underneath that share, that I can not access in any way. My account 'rmasters' owns the folders and my main group.

drwxrws---. 6 rmasters mediastorage  4096 Apr 14 20:18 Torrent
drwxrws---. 4 rmasters mediastorage  4096 Apr 14 20:19 TV

The settings for the share have been added and built on as i've been trying different things to get it to work. So I'm not saying this is the right way.

for the folders themselves i tried doing this:

chmod -R 2550 /mnt/mediastorage 

based of the reading here: https://wiki.samba.org/index.php/Setup_and_configure_file_shares_with_POSIX_ACLs

I originally had them as

chmod -R 775 /mnt/mediastorage

Any ideas what I can do get this fixed?

What I'd like to have is everyone can read and 'rmasters' can write.

Thanks RM

1 Answers1

2

When I have experienced this it was because of SELinux getting in the way.

To test if this is your problem, simply turn off - or change to non-enforcing - the SELinux software.

To do this, edit /etc/selinux/config and set SELINUX to either permissive or disabled. If changing to permissive, restart SELinux with systemctl status selinux.service. If turning it off, you can just use systemctl stop selinux.service in lieu of disabling it.

Once you figure out if it's SELinux, you can either decide to ditch SELinux (in which case you might run systemctl disable selinux.service to keep it from turning on again (in addition to changing the value of SELINUX in /etc/selinux/config). Or you can keep SELinux and learn how to update the file permissions appropriately (which is an exercise beyond the scope of this answer).

Richard T
  • 1,206
  • 12
  • 29
  • you know i thought about this...and I had done the chcon -t samba_share_t on the top directory, but it was after i turned samba on and the subdirectories where already in there. So... I sftp'd the files down and deleted them, then copied them back using samba which gave me the desired result. Luckily I didn't have much in there. Down side to this solution was it didn't prove what the problem was. Yours would have. Thanks for the suggestion though. – Pompey Magnus Apr 16 '15 at 01:32
  • @RobinMasters Glad to give a good suggestion - you can give it an up-vote, you know! Encourage good suggestions! :) And, by the way, SELinux secures ALL the files - it's not just a directory-at-the-top issue; most likely, your re-copying in the files changed their SELinux meta-data and that's what cured it. ... I think a -R flag might have cured it for you without the reload. – Richard T Apr 16 '15 at 17:18
  • Sorry I tried to give an upvote, I don't have the juice. When I get it, I'll try to remember to come back and do that for you. I did do the -R flag on the permissions. But do you mean on the chcon command? – Pompey Magnus Apr 16 '15 at 20:57