Man Pages

chcon - phpMan chcon - phpMan

Command: man perldoc info search(apropos)  


File: coreutils.info,  Node: chcon invocation,  Next: runcon invocation,  Up: SELinux context

22.1 `chcon': Change SELinux context of file
============================================

`chcon' changes the SELinux security context of the selected files.
Synopses:

     chcon [OPTION]... CONTEXT FILE...
     chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...
     chcon [OPTION]... --reference=RFILE FILE...

   Change the SELinux security context of each FILE to CONTEXT.  With
`--reference', change the security context of each FILE to that of
RFILE.

   The program accepts the following options.  Also see *note Common
options::.

`-h'
`--no-dereference'
     Affect symbolic links instead of any referenced file.

`--reference=RFILE'
     Use RFILE's security context rather than specifying a CONTEXT
     value.

`-R'
`--recursive'
     Operate on files and directories recursively.

`-H'
     If `--recursive' (`-R') is specified and a command line argument
     is a symbolic link to a directory, traverse it.  *Note Traversing
     symlinks::.

`-L'
     In a recursive traversal, traverse every symbolic link to a
     directory that is encountered.  *Note Traversing symlinks::.

`-P'
     Do not traverse any symbolic links.  This is the default if none
     of `-H', `-L', or `-P' is specified.  *Note Traversing symlinks::.

`-v'
`--verbose'
     Output a diagnostic for every file processed.

`-u USER'
`--user=USER'
     Set user USER in the target security context.

`-r ROLE'
`--role=ROLE'
     Set role ROLE in the target security context.

`-t TYPE'
`--type=TYPE'
     Set type TYPE in the target security context.

`-l RANGE'
`--range=RANGE'
     Set range RANGE in the target security context.


   An exit status of zero indicates success, and a nonzero value
indicates failure.