coreutils: chcon invocation
1
1 22.1 ‘chcon’: Change SELinux context of file
1 ============================================
1
1 ‘chcon’ changes the SELinux security context of the selected files.
1 Synopses:
1
1 chcon [OPTION]... CONTEXT FILE...
1 chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...
1 chcon [OPTION]... --reference=RFILE FILE...
1
1 Change the SELinux security context of each FILE to CONTEXT. With
1 ‘--reference’, change the security context of each FILE to that of
1 RFILE.
1
11 The program accepts the following options. Also see ⇒Common
options.
1
1 ‘--dereference’
1 Do not affect symbolic links but what they refer to; this is the
1 default.
1
1 ‘-h’
1 ‘--no-dereference’
1 Affect the symbolic links themselves instead of any referenced
1 file.
1
1 ‘--reference=RFILE’
1 Use RFILE’s security context rather than specifying a CONTEXT
1 value.
1
1 ‘-R’
1 ‘--recursive’
1 Operate on files and directories recursively.
1
1 ‘--preserve-root’
1 Refuse to operate recursively on the root directory, ‘/’, when used
11 together with the ‘--recursive’ option. ⇒Treating /
specially.
1
1 ‘--no-preserve-root’
1 Do not treat the root directory, ‘/’, specially when operating
1 recursively; this is the default. ⇒Treating / specially.
1
1 ‘-H’
1 If ‘--recursive’ (‘-R’) is specified and a command line argument is
11 a symbolic link to a directory, traverse it. ⇒Traversing
symlinks.
1
1 ‘-L’
1 In a recursive traversal, traverse every symbolic link to a
1 directory that is encountered. ⇒Traversing symlinks.
1
1 ‘-P’
1 Do not traverse any symbolic links. This is the default if none of
1 ‘-H’, ‘-L’, or ‘-P’ is specified. ⇒Traversing symlinks.
1
1 ‘-v’
1 ‘--verbose’
1 Output a diagnostic for every file processed.
1
1 ‘-u USER’
1 ‘--user=USER’
1 Set user USER in the target security context.
1
1 ‘-r ROLE’
1 ‘--role=ROLE’
1 Set role ROLE in the target security context.
1
1 ‘-t TYPE’
1 ‘--type=TYPE’
1 Set type TYPE in the target security context.
1
1 ‘-l RANGE’
1 ‘--range=RANGE’
1 Set range RANGE in the target security context.
1
1 An exit status of zero indicates success, and a nonzero value
1 indicates failure.
1