Hello,
I had this same problem, but only when trying to create a share inside /var/www on CentOS 7. SELinux didn't like that. I could mount the share and everything, but I could not read, write or execute (or even see) the files in the share.
To see if you have SELinux enabled run:
If it is active you will see the following output, or something similar:
# sestatus
Code:
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
Check
/var/log/audit/audit.log while you are trying to access the share to see if anything comes up.
The easiest and least secure way to fix this is to allow samba to read/write anywhere:
Code:
setsebool -P samba_export_all_rw 1
This change will take effect immediately. You can restart samba for good measure, but it shouldn't be necessary. When I say the command will allow samba to read/write anywhere of course standard filesystem permissions apply, SELinux just won't block it.
If you want to be more specific, you can run:
Code:
chcon -t public_content_rw_t /data/share
setsebool -P allow_smbd_anon_write 1
Alternatively you could run audit2allow to build a module to allow what SELinux is blocking. However, it shouldn't be necessary with the above commands.
To temporarily turn off SELinux altogether, as root run:
Code:
echo 0 > /selinux/enforce
This is a 4 year old thread, but hopefully this info helps someone..
s0nic