chcon
Plan or apply SELinux security context to files. Preview changes with --dry_run, apply with --allow_context.
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'.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"context": "<context>",
"paths": "<paths>"
},
"name": "chcon"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write context/path rows without a JSON envelope. | |
| paths | Yes | Paths whose security context should change. | |
| context | Yes | Security context to apply. | |
| dry_run | No | Report operations without changing contexts. | |
| no_follow | No | Do not follow symlinks where supported. | |
| recursive | No | Apply to directory contents recursively. | |
| allow_context | No | Allow real SELinux context changes where supported. |