commands.sh

newrole

linux

Run a new shell with a different SELinux role. Allows users to switch to a different SELinux security context. See also: `runcon`, `semanage-user`.

More info →

Options (4)

-r, --roleboolean

Start a new shell with a specific SELinux role

Example: newrole {{[-r|--role]}} {{role_name}}
-t, --typeboolean

Start a new shell with a specific SELinux type

Example: newrole {{[-t|--type]}} {{type_name}}
-l, --levelboolean

Start a new shell with a specific SELinux level (format: `s0-s0:c0.c1023` where levels range from `s0` to `s15`, `-` indicates level range, categories start with `c`, `:` separates level from categories, `.` indicates category range)

Example: newrole {{[-l|--level]}} {{s0-s0:c0.c1023}}
-Z, --contextboolean

Display the current SELinux context

Example: id {{[-Z|--context]}}

Examples (5)

Start a new shell with a specific SELinux role

newrole [-r|--role] role_name

Start a new shell with a specific SELinux type

newrole [-t|--type] type_name

Start a new shell with a specific SELinux level (format: `s0-s0:c0.c1023` where levels range from `s0` to `s15`, `-` indicates level range, categories start with `c`, `:` separates level from categories, `.` indicates category range)

newrole [-l|--level] s0-s0:c0.c1023

Display the current SELinux context

id [-Z|--context]

Start a new shell with both role and type

newrole [-r|--role] role_name [-t|--type] type_name
made by @shridhargupta | data from tldr-pages