failsafe_context(5)
π failsafe_context(5) π
okay so bestie, welcome to the manual page for failsafe_context β it's a (5) page, which means it's about a config file, and it lives in the SELinux configuration section of the man pages. no cap, this one's short but it's lowkey a hero.
β¨ NAME β¨
failsafe_context β the SELinux fail safe context configuration file. it's giving "backup plan but make it a whole file" π«Ά
πΈ DESCRIPTION πΈ
the failsafe_context file lets SELinux-aware applications β think PAM(8) β grab a known valid login context for an administrator, but only if no valid default entries can be found anywhere else. it's the emergency snack in the back of the pantry. the moment you need it, you're so glad it's there. π
selinux_failsafe_context_path(3) will return the active policy path to this file. the default failsafe context file is:
/etc/selinux/{SELINUXTYPE}/contexts/failsafe_context
where {SELINUXTYPE} is the entry from the selinux configuration file config (see selinux_config(5)). iykyk π
the following functions read this file from the active policy path if they cannot obtain a default context:
get_default_context(3)get_ordered_context_list(3)get_ordered_context_list_with_level(3)get_default_context_with_level(3)get_default_context_with_role(3)get_default_context_with_rolelevel(3)query_user_context(3)manual_user_enter_context(3)
like, all eight of them. they all come running to this file when things go sideways. iconic behaviour honestly. π
π FILE FORMAT π
the file consists of a single line entry, and it goes a lil something like this:
role:type[:range]
where:
role,type,rangeβ a role, a type, and an optional range (for MCS/MLS), separated by colons (:) to form a valid login process context so an administrator can access the system. that's it. one line. one vibe. β¨
heads up bestie: it really is a single line. don't go writing a novel in there, the format is role:type[:range] and that's the whole story. π
π EXAMPLE π
# ./contexts/failsafe_context
unconfined_r:unconfined_t:s0
look at her. one line. perfect. no notes. π
π¦ SEE ALSO π¦
selinux(8)selinux_failsafe_context_path(3)PAM(8)selinux_default_type_path(3)get_default_context(3)get_ordered_context_list(3)get_ordered_context_list_with_level(3)get_default_context_with_level(3)get_default_context_with_role(3)get_default_context_with_rolelevel(3)query_user_context(3)manual_user_enter_context(3)selinux_config(5)
and that's the whole page, bestie!! this one came from Security Enhanced Linux, dated 28-Nov-2011, and it's filed under failsafe_context(5). go forth and never get locked out of your own system, mwah πβ¨
stay safe out there, admin π
π¦ where this page comes from
- alpine 3.24: libselinux-doc 3.10-r1 Β· Public-Domain
- centos-stream 10: libselinux-utils 3.11-3.el10 Β· LicenseRef-Fedora-Public-Domain
- centos-stream 9: libselinux-utils 3.6-5.el9 Β· Public Domain
- debian bookworm: selinux-utils 3.4-1+b6
- debian trixie: selinux-utils 3.8.1-1 Β· LicenseRef-public-domain
- fedora 43: libselinux-utils 3.9-5.fc43 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-utils 3.10-1.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-utils 3.11-2.fc44 Β· LicenseRef-Fedora-Public-Domain
- nixos 26.05: libselinux 3.10
- nixpkgs unstable: libselinux 3.11
- opensuse-leap 16.0: selinux-tools 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: selinux-tools 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: selinux-tools 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: selinux-tools 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- ubuntu jammy: selinux-utils 3.3-1build2
- ubuntu noble: selinux-utils 3.5-2ubuntu2 Β· LicenseRef-public-domain
- ubuntu noble: selinux-utils 3.5-2ubuntu2.1 Β· LicenseRef-public-domain
- ubuntu questing: selinux-utils 3.8.1-1build1
- ubuntu resolute: selinux-utils 3.9-4build1 Β· LicenseRef-public-domain
- ubuntu stonking: selinux-utils 3.11-2.1 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms