setfiles
Set SELinux file security contexts based on policy rules. tldr-pages
On Linux
Linux
Set SELinux file security contexts based on policy rules. Similar to restorecon but reads contexts from a file_contexts file.
Set file contexts according to the default policy file
sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts path/to/directoryIdentifySet file contexts recursively and show changes
sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts path/to/directory --verboseIdentifyPreview what would be changed without actually modifying contexts
sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts path/to/directory --nochangeIdentifySet file contexts and verify them
sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts path/to/directory --verbose --forceIdentifyUse a specific root path for context matching
sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts path/to/new_directory --rootpath path/to/old_directoryIdentify