Chapter 4
- The most common option is -Z, and is supported by tools such as ls, mv, and ps. The same character is also used by systemd's tmpfiles application to explicitly set SELinux contexts on resources. However, while this is the most commonly used option, not all tools follow this convention, so we recommend to always consult the tool's help or manual page.
- In most cases, the context is stored as an extended attribute of the file or directory within the filesystem. This extended attribute is the
security.selinux
attribute, and can be queried with tools such asgetfattr
orstat
.However, not all filesystems support extended attributes. In that case, the SELinux context is obtained through the mount options of that filesystem, and all resources on the filesystem then use the same context.
- The
chcon
application directly alters the SELinux context for a file, but does not adjust the system's file context definitions. If, at any point in time, the system or...