SELinux: remove and restore security context for files 

Joined:
04/07/2009
Posts:
145

April 14, 2011 13:48:29    Last update: April 14, 2011 13:49:29
The SELinux security context for files is stored in the form of an extended file attribute.
  • To remove security context in a file:
    setfattr -x security.selinux file_name
    

    But you have to boot with SELinux disabled before you can do that.

  • To restore security context in a file:
    restorecon -v file_name
    

Share |
| Comment  | Tags