There is "small" difference between
and
The first one only set contex for specified file, but when file id deleted and created again or restored from backup (ie. tar without --selinux attribute) the changed context is not restored.
To permanently change context to file or some files, even created you have to use semanage:
to change context to directory /some/dir and all files in this directory.
Add comment