chcon
Plan or apply SELinux security context changes to files. Preview with --dry_run and execute with --allow_context to alter file security labels.
Instructions
Plan or apply an SELinux security context to files. Destructive: may alter file security labels, affecting access control. Use --dry_run to preview without changes. Requires --allow_context for actual execution; fails safely otherwise. Use to manage SELinux contexts on labeled filesystems. Not for general permission changes — use 'chmod'. See also 'runcon', 'chmod'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| allow_context | No | Allow real SELinux context changes where supported. | |
| context | Yes | Security context to apply. | |
| dry_run | No | Report operations without changing contexts. | |
| no_follow | No | Do not follow symlinks where supported. | |
| paths | Yes | Paths whose security context should change. | |
| raw | No | Write context/path rows without a JSON envelope. | |
| recursive | No | Apply to directory contents recursively. |