Difference between chcon and semanage in SE Linux
There is "small" difference between
chcon -t some_file_type_t /some/file
and
semanage fcontext -a -t some_file_type_t /some/file restorecon -v /some/file
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:
semanage fcontext -a -t fome_file_type_t "/some/dir(/.*)?"
to change context to directory /some/dir and all files in this directory.
Kommentare
Bitte melden Sie sich Logan oder registrieren Sie sich um kommentieren zu können.