CHCAT(8)
π NAME π
chcat β bestie, this is the one that changes SELinux security categories of files and users β¨
πΈ SYNOPSIS πΈ
chcat category file...
chcat -l category user...
chcat [[+|-]category...] file...
chcat -l [[+|-]category...] user...
chcat [-d] file...
chcat -l [-d] user...
chcat -L [ -l ] [ user ... ]
π¦ DESCRIPTION π¦
okay so here's the vibe π
you use + and - to add or remove categories from a file or a user β and heads up, only a single category can be specified at a time when you're doing that. OR, plot twist, you just hand over the whole list/range of categories you want applied, and it replaces whatever categories were already there. main character energy, honestly. β¨
π¨ real talk, bestie, this one matters: when you're removing a category you must put'--'on the command line before you use the-Categorysyntax. That--is basically telling the command "okay i'm done with options, everything after this is a category name, not a flag." it's giving β stop sign, no cap.
-dβ delete all categories from the given FILE/USER. every last one. bye π-Lβ list the available categories. window shopping fr fr ποΈ-lβ tellschcatto operate on users instead of files. lowercase L, tiny but mighty π
π EXAMPLE π
Replace categories of user "test" with c0.c6
# chcat -l c0.c6 test
Add category c1023 to user "test"
# chcat -l +c1023 test
Remove category c5 from file "file"
# chcat -- -c5 file
Remove all categories from file "file"
# chcat -d file
π SEE ALSO π
Also, fun fact: when it's operating on files, this script is just wrapping the chcon command π«Ά like a cute lil jacket over a classic.
π FILES π
/etc/selinux/{SELINUXTYPE}/setrans.conf/etc/selinux/{SELINUXTYPE}/seusers
and that's the whole page, bestie!! π this one's the chcat manual page, from the User Commands section of the manual (section 8, for the system admin girlies), and it's dated September 2005 β yeah she's vintage, she's an icon, she ate and left no crumbs πβ¨ slay, go change some categories, mwah π
π¦ where this page comes from
- centos-stream 10: policycoreutils-python-utils 3.10-2.el10 Β· GPL-2.0-or-later
- centos-stream 10: policycoreutils-python-utils 3.11-1.el10 Β· GPL-2.0-or-later
- centos-stream 9: policycoreutils-python-utils 3.6-7.el9 Β· GPL-2.0-or-later
- centos-stream 9: policycoreutils-python-utils 3.6-9.el9 Β· GPL-2.0-or-later
- debian trixie: policycoreutils-python-utils 3.8.1-2 Β· GPL-2.0-or-later
- fedora 43: policycoreutils-python-utils 3.9-5.fc43 Β· GPL-2.0-or-later
- fedora 43: policycoreutils-python-utils 3.9-7.fc43 Β· GPL-2.0-or-later
- fedora 44: policycoreutils-python-utils 3.10-1.fc44 Β· GPL-2.0-or-later
- fedora 44: policycoreutils-python-utils 3.11-2.fc44 Β· GPL-2.0-or-later
- nixos 26.05: selinux-python 3.10
- nixpkgs unstable: selinux-python 3.10
- opensuse-leap 16.0: policycoreutils-python-utils 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- ubuntu questing: policycoreutils-python-utils 3.8.1-2
- ubuntu resolute: policycoreutils-python-utils 3.9-2 Β· GPL-2.0-or-later
- ubuntu stonking: policycoreutils-python-utils 3.11-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms