2019-10-29 02:45:37 -04:00
|
|
|
# runcon
|
|
|
|
|
|
|
|
> Run a program in a different SELinux security context.
|
2024-05-27 23:54:20 +08:00
|
|
|
> See also: `secon`.
|
2025-01-18 18:45:33 +05:30
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/runcon-invocation.html>.
|
2019-10-29 02:45:37 -04:00
|
|
|
|
2024-05-27 23:54:20 +08:00
|
|
|
- Print the security context of the current execution context:
|
2019-10-29 02:45:37 -04:00
|
|
|
|
|
|
|
`runcon`
|
|
|
|
|
|
|
|
- Specify the domain to run a command in:
|
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`runcon {{[-t|--type]}} {{domain}}_t {{command}}`
|
2019-10-29 02:45:37 -04:00
|
|
|
|
|
|
|
- Specify the context role to run a command with:
|
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`runcon {{[-r|--role]}} {{role}}_r {{command}}`
|
2019-10-29 02:45:37 -04:00
|
|
|
|
|
|
|
- Specify the full context to run a command with:
|
|
|
|
|
|
|
|
`runcon {{user}}_u:{{role}}_r:{{domain}}_t {{command}}`
|