Change the full SELinux security context of a file

chcon

  • Change SELinux security context of a file or files/directories.
    More information: <https://www.gnu.org/software/coreutils/chcon>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

chcon {{user}}:{{role}}:{{type}}:{{range/level}} {{filename}}

click the source code to copy install chcon on any operating system with command-not-found.com