default\_contexts(5) SELinux configuration default\_contexts(5)

# [NAME](#NAME)

default\_contexts - The SELinux default contexts configuration file

# [DESCRIPTION](#DESCRIPTION)

The default contexts configuration file *default\_contexts* contains entries that allow SELinux-aware login applications such as [**PAM**(8)](/man/os/libselinux/PAM.8)

SELinux-aware login applications generally use one or more of the following libselinux functions that read these files from the active policy path:

[**get\_default\_context**(3)](/man/os/libselinux/get_default_context.3)  
[**get\_ordered\_context\_list**(3)](/man/os/libselinux/get_ordered_context_list.3)  
[**get\_ordered\_context\_list\_with\_level**(3)](/man/os/libselinux/get_ordered_context_list_with_level.3)  
[**get\_default\_context\_with\_level**(3)](/man/os/libselinux/get_default_context_with_level.3)  
[**get\_default\_context\_with\_role**(3)](/man/os/libselinux/get_default_context_with_role.3)  
[**get\_default\_context\_with\_rolelevel**(3)](/man/os/libselinux/get_default_context_with_rolelevel.3)  
[**query\_user\_context**(3)](/man/os/libselinux/query_user_context.3)  
[**manual\_user\_enter\_context**(3)](/man/os/libselinux/manual_user_enter_context.3)

The default context configuration file path for the active policy is returned by [**selinux\_default\_contexts\_path**(3)](/man/os/libselinux/selinux_default_contexts_path.3). The default, default contexts file is:

*/etc/selinux/{SELINUXTYPE}/contexts/default\_contexts*

Where *{SELINUXTYPE}* is the entry from the selinux configuration file *config* (see [**selinux\_config**(5)](/man/os/libselinux/selinux_config.5)).

# [FILE FORMAT](#FILE_FORMAT)

Each line in the default configuration file consists of the following:

*login\_process user\_login\_process \[user\_login\_process] ...*

Where:

*login\_process*

This consists of a *role:type*\[**:range**] entry that represents the login process context that are defined in the policy.

*user\_login\_process*

This consists of one or more *role:type*\[**:range**] entries that represent the user login process context defined in the policy.

# [EXAMPLE](#EXAMPLE)

\# ./contexts/default\_contexts  
system\_r:crond\_t:s0 system\_r:system\_crond\_t:s0  
system\_r:local\_login\_t:s0 user\_r:user\_t:s0 staff\_r:staff\_t:s0  
system\_r:remote\_login\_t:s0 user\_r:user\_t:s0  
system\_r:sshd\_t:s0 user\_r:user\_t:s0  
system\_r:sulogin\_t:s0 sysadm\_r:sysadm\_t:s0  
system\_r:xdm\_t:s0 user\_r:user\_t:s0

# [SEE ALSO](#SEE_ALSO)

[**selinux**(8)](/man/os/libselinux/selinux.8), [**selinux\_default\_contexts\_path**(3)](/man/os/libselinux/selinux_default_contexts_path.3), [**PAM**(8)](/man/os/libselinux/PAM.8), [**selinux\_default\_type\_path**(3)](/man/os/libselinux/selinux_default_type_path.3), [**get\_default\_context**(3)](/man/os/libselinux/get_default_context.3), [**get\_ordered\_context\_list**(3)](/man/os/libselinux/get_ordered_context_list.3), [**get\_ordered\_context\_list\_with\_level**(3)](/man/os/libselinux/get_ordered_context_list_with_level.3), [**get\_default\_context\_with\_level**(3)](/man/os/libselinux/get_default_context_with_level.3), [**get\_default\_context\_with\_role**(3)](/man/os/libselinux/get_default_context_with_role.3), [**get\_default\_context\_with\_rolelevel**(3)](/man/os/libselinux/get_default_context_with_rolelevel.3), [**query\_user\_context**(3)](/man/os/libselinux/query_user_context.3), [**manual\_user\_enter\_context**(3)](/man/os/libselinux/manual_user_enter_context.3), [**selinux\_config**(5)](/man/os/libselinux/selinux_config.5)

28-Nov-2011 Security Enhanced Linux

---

Document: default_contexts(5) from libselinux 3.11-r2 (Chainguard OS)
Source: https://github.com/SELinuxProject/selinux.git
