Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

Yes, just set the appropriate boolean:

setsebool -P samba_share_nfs 1
share|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 at 19:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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