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 16129 times.

Share your Linux code snippets:

  • Get some recognition & a link back to your site.
  • Create your own code library.
  • Help your fellow developers, as they have helped you.


Submit | Browse

Most Recent linux snippets

Most Viewed