Bootstrap FreeKB - TAR - retain SELinux context
TAR - retain SELinux context

Updated:   |  TAR articles

The --selinux option can be used to retain the SELinux context of files in a tar archive. In this example, example.tar contains the contents of the /etc directory and retains the SELinux context of the files in the /etc directory.

tar --selinux -cf /home/john.doe/example.tar /etc 

 

Or, this might be a situation where it make more sense to use star instead of tar, because star automatically retains SELinux context.




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 69e918 in the box below so that we can be sure you are a human.