SELinux context

The label user:role:type:level that SELinux attaches to every file and process, of which the type is what the policy checks.

In more detail

A new file takes the type of its directory, while a moved file keeps its old label. The policy's file contexts map paths to types; restorecon applies that map, and semanage fcontext -a adds a local rule to it. chcon changes a label directly, but a relabel puts the mapped type back.

Examples

semanage fcontext -a -t httpd_sys_content_t '/web(/.*)?'
restorecon -Rv /web

Related terms

Taught in

References

Certification courses