FileLabelRecipe

From SELinux Wiki
Revision as of 14:52, 27 October 2009 by ChrisPeBenito (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

If you want to change the context of a file the chcon program. However, changes made this way will not preserved if the file is relabeled by using restorecon or using the /.autorelabel file and rebooting.

# semanage fcontext -a -t myfile_t /path/to/myfile

This will add an entry in the system file contexts. This entry will be persistent, even when the distribution policy is updated. However, if you change policies, e.g. from targeted to mls, you will have to re-run the above command to add it to the new policy.