Those who installed Samba on Fedora or any other SELinux enabled distribution may have faced the problem when they actually cannot access any Samba shares from their Windows machines. Samba logs in /var/samba/log may show lots of such messages:
[2007/07/03 16:37:44, 0] smbd/service.c:make_connection_snum(911) '/opt/blah' does not exist or permission denied when connecting to [blah] Error was Permission denied
- This is probably an SELinux problem and to fix it you’ll need to execute:
chcon -R -t samba_share_t /opt
chcon -R -t public_content_t /opt
/opt(/.*)? system_u:object_r:samba_share_t:s0
/opt(/.*)? system_u:object_r:public_content_t:s0
restorecon -v -R /opt/
This will set appropriate SELinux context on all files in /opt directory and SELinux won’t prevent Samba access anymore.
setsebool -P samba_export_all_rw 1
setsebool -P samba_enable_home_dirs 1