chcon(1)

πŸ“¦
version 0.7.0 Β· 3 versions
, in epel 10, fedora 43, fedora 44

πŸ’… 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 -R is specified.
  • -L β€” traverse every symbolic link to a directory encountered. Only valid when -R is specified.
  • -P β€” do not traverse any symbolic links (default). Only valid when -R is 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, -L and -P are only valid when -R is 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