Linux command
runcon 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
runcon
Example
runcon -t domain_t command
Example
runcon -r role_r command
Example
runcon user_u:role_r:domain_t command
说明
runcon runs a program in a different SELinux security context. It allows executing commands with specific SELinux user, role, and type labels. This is useful for testing SELinux policies and running programs in restricted contexts.
参数
- -u, --user _user_
- Specify SELinux user identity.
- -r, --role _role_
- Specify SELinux role.
- -t, --type _type_
- Specify SELinux domain/type (requires the same role and user).
- -l, --range _range_
- Specify SELinux MLS/MCS level range.
- --compute
- Compute the target process security context before modifying.
- --help
- Display help information.
- --version
- Output version information.
FAQ
What is the runcon command used for?
runcon runs a program in a different SELinux security context. It allows executing commands with specific SELinux user, role, and type labels. This is useful for testing SELinux policies and running programs in restricted contexts.
How do I run a basic runcon example?
Run `runcon` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -u, --user _user_ do in runcon?
Specify SELinux user identity.