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
| improve this answer | |
  • I had done a search like so: getsebool -a | grep -iE "use.*nfs" and I didn't think to check for other nfs sebools. I was thinking a "samba_use_nfs" boolean, but that's not correct. Thanks, @Michael Hampton! – bgStack15 Jun 24 '16 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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