Linux Remove SELinux security context from files

The setfattr command does not supply a recursive option, so the second command below uses find to achieve recursion.
setfattr -h -x security.selinux
find . -print0 |xargs -0 -n 1 setfattr -h -x security.selinux

#for apache
chcon --reference=/etc/httpd/modules/ [the file(s)]
chcon -u system_u [the files(s)]
chcon -R -h -t httpd_sys_content_t [the file(s)]
Posted by
Snippet Viewed 16623 times.

Share your Linux code snippets:

  • Get some recognition & link back to your site.


Submit | Browse

Most Recent linux snippets

Most Viewed