chcon(1)
π chcon(1) β the glow-up your SELinux security contexts have been waiting for
okay bestie, listen. this is chcon, and it lives in the General Commands Manual section (that's chcon(1) if you're keeping receipts π). she does one thing and she does it iconically: she changes the SELinux security context of each FILE to CONTEXT. and if you pass --reference? she changes the security context of each FILE to that of RFILE instead. no cap. π
β¨ NAME β¨
chcon β Change the SELinux security context of each FILE to CONTEXT. With --reference, change the security context of each FILE to that of RFILE.
π¦ SYNOPSIS π¦
chcon [--dereference] [-h|--no-dereference] [--help] [--preserve-root]
[--no-preserve-root] [--reference] [-u|--user] [-r|--role] [-t|--type]
[-l|--range] [-R|--recursive] [-H ] [-L ] [-P ] [-v|--verbose]
[-V|--version] [FILE]
πΈ DESCRIPTION πΈ
so here's the tea β: chcon changes the SELinux security context of each FILE to CONTEXT. that's the whole main character arc.
but if you're feeling like copying someone else's vibe β pass --reference and she'll change the security context of each FILE to that of RFILE instead. matching fits, bestie π«Ά
π OPTIONS π
--dereferenceβ affect the referent of each symbolic link (this is the default, so she's already doing this unless you say otherwise), rather than the symbolic link itself.-h,--no-dereferenceβ affect symbolic links instead of any referenced file. she's looking at the link herself, not who it's pointing at π--helpβ help--preserve-rootβ fail to operate recursively on'/'. like, she refuses. protective queen behavior π--no-preserve-rootβ do not treat'/'specially (this is the default).--reference <RFILE>β use the security context of RFILE, rather than specifying a CONTEXT value. copy her outfit, don't build your own π-u,--user <USER>β set user USER in the target security context.-r,--role <ROLE>β set role ROLE in the target security context.-t,--type <TYPE>β set type TYPE in the target security context.-l,--range <RANGE>β set range RANGE in the target security context.-R,--recursiveβ operate on files and directories recursively. she goes deep π-Hβ if a command line argument is a symbolic link to a directory, traverse it. Only valid when-Ris specified.-Lβ traverse every symbolic link to a directory encountered. Only valid when-Ris specified.-Pβ do not traverse any symbolic links (default). Only valid when-Ris specified.-v,--verboseβ output a diagnostic for every file processed. she will narrate. every. single. file. π£οΈ-V,--versionβ print version[FILE]β the file(s) in question, bestie
fr fr, don't forget:-H,-Land-Pare only valid when-Ris specified. no-R, no traversal drama π
β VERSION β
v(uutils coreutils) 0.7.0
and that's the whole page, periodt π this was chcon (uutils coreutils) 0.7.0, page chcon(1), and she ate. now go fix those security contexts, you gorgeous little sysadmin π§β¨π
π¦ where this page comes from
- epel 10: rust-coreutils-devel 0.7.0-10.el10_3 Β· MIT
- epel 10: uutils-coreutils 0.7.0-10.el10_3 Β· (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT OR Zlib OR Apache-2.0) AND (MIT-0 OR Apache-2.0) AND Unicode-3.0 AND (Unlicense OR MIT)
- fedora 43: rust-coreutils-devel 0.7.0-12.fc43 Β· MIT
- fedora 43: uutils-coreutils 0.7.0-12.fc43 Β· (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT OR Zlib OR Apache-2.0) AND (MIT-0 OR Apache-2.0) AND Unicode-3.0 AND (Unlicense OR MIT)
- fedora 44: rust-coreutils-devel 0.7.0-4.fc44 Β· MIT
- fedora 44: uutils-coreutils 0.7.0-4.fc44 Β· (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Zlib AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT OR Zlib OR Apache-2.0) AND (MIT-0 OR Apache-2.0) AND Unicode-3.0 AND (Unlicense OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms