1
  • in RHEL 7.9, samba-4.10.16-19, nfs-utils-1.3.0,
  • server A and server B both have SELINUX as enforcing
  • from server A, the folder /data is NFS exported.
  • on server B, mount A:/data /data successfully mounts as NFS v4.1.
  • on server B if I samba share out /data which is nfs mounted, it cannot be accessed until I do setenforce 0 on server B.
  • on server A, /data has the samba_share_t label and will samba share out from server A.
  • on server B where /data is nfs mounted, it has the nfs_t label and I am unable to get the samba_share_t label to be applied with an semanage fcontext -a -t samba_share_t "/data(/.*)?"

What are the do's and dont's regarding samba sharing folders, NFS, and SELINUX as I have described it? I really want to be able to samba share out the nfs mounted folder from server B because that's where all the user accounts and permissions information resides, everyone has a user account on server B that creates data under /data but they do not have an account on server A where /data physically resides and I do not want to have to create user accounts on server A.

2 Answers 2

1

regarding samba not working with an NFS mounted folder...

getsebool -a | grep samba

by default samba_share_nfs is off.

doing an setsebool -P samba_share_nfs on

fixes that. The -P is for persistence, otherwise it'll be off again after reboot.

0

It isn't a good idea to use Samba to share an NFS mount, so I can't recommend you do this. NFS uses nfsv4 acls and Samba doesn't.

You must log in to answer this question.

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