---
name: "default_contexts"
section: "5"
platform: "linux"
package: "selinux-utils"
version: "3.8.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/default_contexts"
---

# default\_contexts(5)

The SELinux default contexts configuration file

## NAME

default\_contexts - The SELinux default contexts configuration file

## DESCRIPTION

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

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)](/get_default_context/3.md) \
 [**get\_ordered\_context\_list**(3)](/get_ordered_context_list/3.md) \
 [**get\_ordered\_context\_list\_with\_level**(3)](/get_ordered_context_list_with_level/3.md) \
 [**get\_default\_context\_with\_level**(3)](/get_default_context_with_level/3.md) \
 [**get\_default\_context\_with\_role**(3)](/get_default_context_with_role/3.md) \
 [**get\_default\_context\_with\_rolelevel**(3)](/get_default_context_with_rolelevel/3.md) \
 [**query\_user\_context**(3)](/query_user_context/3.md) \
 [**manual\_user\_enter\_context**(3)](/manual_user_enter_context/3.md)

The default context configuration file path for the active policy is returned by **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)](/selinux_config/5.md)).

## 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

\# ./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

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