removable_context(5)
π removable_context(5) π
okay so bestie, welcome to removable_context from the SELinux config collection β this is the little file that decides what label your USB stick, your SD card, your random thrifted flash drive gets when you plug it in. yes it's one line. yes it's iconic. let's go β¨
πΈ NAME πΈ
removable_context β the SELinux removable devices context configuration file π
β¨ DESCRIPTION β¨
so basically this file holds the default label that should be used for removable devices. that's it. that's the whole job. and honestly? she ate. π
selinux_removable_context_path(3) will hand you the active policy path to this file, in case you forgot where you left it (we've all been there π«Ά).
the default removable context file is:
/etc/selinux/{SELINUXTYPE}/contexts/removable_context
and where does {SELINUXTYPE} come from, you ask? it's the entry from the selinux configuration file config (go peek at selinux_config(5), she explains everything π).
π¦ FILE FORMAT π¦
the file is literally a single line entry, no cap. and it looks like this:
user:role:type[:range]
where:
user,role,type,rangeβ a user, role, type and optional range (for MCS/MLS) separated by colons (:) that will be applied to removable devices. therangepart is optional bestie, she's just there for the MCS/MLS girlies π
π EXAMPLE π
here's what it looks like irl:
# ./contexts/removable_contexts
system_u:object_r:removable_t:s0
look at that. clean. perfect. no notes. π₯
π SEE ALSO π
and that's the whole page bestie, you understood it on the first read because you're the main character π§
this was brought to you by Security Enhanced Linux, dated 28-Nov-2011 β yeah she's vintage but she still slays π
π¦ 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