Difference between revisions of "FileLabelRecipe"

From SELinux Wiki
Jump to: navigation, search
(New page: 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 /.autore...)
(No difference)

Revision as of 14:52, 27 October 2009

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.