Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 2 down vote accepted

Yes, just set the appropriate boolean:

setsebool -P samba_share_nfs 1
share|improve this answer
add comment

Your Answer

 
discard

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.