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 {{[-l|--list]}}

sudo semanage fcontext {{[-l|--list]}} {{[-C|--locallist]}} {{[-n|--noheading]}}

sudo semanage fcontext {{[-a|--add]}} {{[-t|--type]}} {{samba_share_t}} {{'/mnt/share(/.*)?'}}

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

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