semanage fcontext

Manage persistent SELinux security context rules on files/directories. See also: semanage, matchpathcon, secon, chcon, restorecon. More information: https://manned.org/semanage-fcontext.

sudo semanage fcontext --list

sudo semanage fcontext --list --locallist --noheading

sudo semanage fcontext --add --type {{samba_share_t}} {{'/mnt/share(/.*)?'}}

sudo semanage fcontext --delete {{'/mnt/share(/.*)?'}}

restorecon -R -v {{path/to/directory}}