I have two CentOS hosts. The first is NAS and the second one is a diskless SMB server. The NAS server share folder via NFS and secure Ethernet connection with SMB server. SMB server shares content to Intranet, WiFi, etc.
When I run this command, I’ve got some trouble:
[root@smbserver ~]# chcon -t samba_share_t /mnt/distr/ chcon: failed to change context of `/mnt/distr/' to `system_u:object_r:samba_share_t:s0': Operation not supported
I tried to mount this share with option in /etc/fstab:
nasserver:/mnt/distr /mnt/distr nfs context="system_u:object_r:samba_share_t:s0" 0 0
But this also does not help.
Is there a way to share via SMB a filesystem mounted via NFS without disabling SElinux?
Yes, just set the appropriate boolean:
setsebool -P samba_share_nfs 1
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.