NEWROLE(1)
β¨ NEWROLE(1) β¨
okay bestie so this is a page from the General Commands Manual, and it's all about a little tool called newrole π
no cap, it's a whole glow-up for your shell.
πΈ NAME πΈ
newrole β run a shell with a new SELinux role π¦
π SYNOPSIS π
newrole [-r|--role] ROLE [-t|--type] TYPE [-l|--level] [-p|--preserve-environment] LEVEL [-- [ARGS]...]
π DESCRIPTION π
so basically you run a whole new shell inside a whole new context. main character energy, but make it a security context β¨
The new context is derived from the old context in which newrole is originally executed. If the -r or --role option is specified, then the new context will have the role specified by ROLE. If the -t or --type option is specified, then the new context will have the type (domain) specified by TYPE. If a role is specified, but no type is specified, the default type is derived from the specified role. If the -l or --level option is specified, then the new context will have the sensitivity level specified by LEVEL. If LEVEL is a range, the new context will have the sensitivity level and clearance specified by that range. If the -p or --preserve-environment option is specified, the shell with the new SELinux context will preserve environment variables, otherwise a new minimal environment is created. π«Ά
Additional arguments ARGS may be provided after a -- option, in which case they are supplied to the new shell. In particular, an argument of -- -c will cause the next argument to be treated as a command by most command interpreters. π
If a command argument is specified to newrole and the command name is found in /etc/selinux/newrole_pam.conf, then the pam service name listed in that file for the command will be used rather than the normal newrole pam configuration. This allows for per-command pam configuration when invoked via newrole, e.g. to skip the interactive re-authentication phase. iykyk π₯
The new shell will be the shell specified in the user's entry in the /etc/passwd file.
The -V or --version shows the current version of newrole
π EXAMPLE π
Changing role:
# id -Z
staff_u:staff_r:staff_t:SystemLow-SystemHigh
# newrole -r sysadm_r
# id -Z
staff_u:sysadm_r:sysadm_t:SystemLow-SystemHigh
Changing sensitivity only:
# id -Z
staff_u:sysadm_r:sysadm_t:Unclassified-SystemHigh
# newrole -l Secret
# id -Z
staff_u:sysadm_r:sysadm_t:Secret-SystemHigh
Changing sensitivity and clearance:
# id -Z
staff_u:sysadm_r:sysadm_t:Unclassified-SystemHigh
# newrole -l Secret-Secret
# id -Z
staff_u:sysadm_r:sysadm_t:Secret
Running a program in a given role or level:
# newrole -r sysadm_r -- -c "/path/to/app arg1 arg2..."
# newrole -l Secret -- -c "/path/to/app arg1 arg2..."
π FILES π
/etc/passwdβ user account information/etc/shadowβ encrypted passwords and age information/etc/selinux/<policy>/contexts/default_typeβ default types for roles/etc/selinux/<policy>/contexts/securetty_typesβ securetty types for level changes/etc/selinux/newrole_pam.confβ optional mapping of commands to separate pam service names
π¦ SEE ALSO π¦
π AUTHORS π
- Anthony Colatrella
- Tim Fraser
- Steve Grubb
<sgrubb@redhat.com> - Darrel Goeddel
<DGoeddel@trustedcs.com> - Michael Thompson
<mcthomps@us.ibm.com> - Dan Walsh
<dwalsh@redhat.com>
and that's the whole thing bestie π this page came to you from Security Enhanced Linux, dated October 2000, and it's giving vintage-but-iconic, fr fr. go forth and slay your contexts πβ¨π
π¦ where this page comes from
- centos-stream 10: policycoreutils-newrole 3.11-1.el10 Β· GPL-2.0-or-later
- centos-stream 9: policycoreutils-newrole 3.6-9.el9 Β· GPL-2.0-or-later
- debian trixie: newrole 3.8.1-2
- fedora 43: policycoreutils-newrole 3.9-5.fc43 Β· GPL-2.0-or-later
- fedora 43: policycoreutils-newrole 3.9-7.fc43 Β· GPL-2.0-or-later
- fedora 44: policycoreutils-newrole 3.10-1.fc44 Β· GPL-2.0-or-later
- fedora 44: policycoreutils-newrole 3.11-2.fc44 Β· GPL-2.0-or-later
- nixos 26.05: policycoreutils 3.11
- nixpkgs unstable: policycoreutils 3.11
- opensuse-leap 16.0: policycoreutils-newrole 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils-newrole 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils-newrole 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils-newrole 3.8.1-160000.5.1 Β· GPL-2.0-or-later
- ubuntu questing: newrole 3.8.1-1
- ubuntu resolute: newrole 3.9-2
- ubuntu stonking: newrole 3.11-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms