3

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?

1 Answer 1

4

Yes, just set the appropriate boolean:

setsebool -P samba_share_nfs 1
1
  • 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
    Commented Jun 24, 2016 at 19:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .