semanage-login(8)

πŸ“¦
version 3.11 Β· 2 versions
, in centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– semanage-login β€” the SELinux login mapping glow-up πŸ’–

okay bestie, welcome to semanage-login(8) β€” yes that's the manual name, it's part of the semanage family, and it's literally the tool that tells your system "hey, this Linux user logs in as this SELinux user". Let's get into it πŸ¦‹


✨ NAME ✨

semanage-login β€” SELinux Policy Management linux user to SELinux User mapping tool


πŸŽ€ SYNOPSIS πŸŽ€

semanage login [-h] [-n] [-N] [-S STORE] [ --add -s SEUSER -r RANGE
LOGIN | --delete LOGIN | --deleteall | --extract | --list [-C] |
--modify -s SEUSER -r RANGE LOGIN ]

🌸 DESCRIPTION 🌸

So semanage is the whole vibe for configuring certain elements of SELinux policy without needing to modify or recompile anything from policy sources. no cap. πŸ™Œ

And semanage login specifically? It controls the mapping between a Linux User and the SELinux User. That's it, that's the whole job, and it's kind of a big deal because it can be used to turn on confined users πŸ‘‘

For example β€” and this is the fun part β€” you could define that a particular user, or a whole group of users, will login to a system as the user_u user. cute, right?

pro tip from the manpage itself: prefix the group name with a % sign to indicate a group name πŸ’…

πŸ’… OPTIONS πŸ’…

  • -h, --help β€” Show this help message and exit. the classic escape hatch 🫢
  • -n, --noheading β€” Do not print heading when listing the specified object type
  • -N, --noreload β€” Do not reload policy after commit
  • -C, --locallist β€” List local customizations
  • -S STORE, --store STORE β€” Select an alternate SELinux Policy Store to manage
  • -a, --add β€” Add a record of the specified object type
  • -d, --delete β€” Delete a record of the specified object type
  • -m, --modify β€” Modify a record of the specified object type
  • -l, --list β€” List records of the specified object type
  • -E, --extract β€” Extract customizable commands, for use within a transaction
  • -D, --deleteall β€” Remove all local customizations
  • -s SEUSER, --seuser SEUSER β€” SELinux user name
  • -r RANGE, --range RANGE β€” MLS/MCS Security Range (MLS/MCS Systems only). SELinux Range for SELinux login mapping defaults to the SELinux user record range. SELinux Range for SELinux user defaults to s0.

🌈 EXAMPLE 🌈

Set the default SELinux user on the system to guest_u

# semanage login -m -s guest_u __default__

Map user gijoe to SELinux user staff_u and assign MLS range SystemLow-Secret

# semanage login -a -s staff_u -rSystemLow-Secret gijoe

Map all users in the engineering group to SELinux user staff_u

# semanage login -a -s staff_u %engineering

πŸ‘€ SEE ALSO πŸ‘€

selinux(8), semanage(8), semanage-user(8)


🫢 AUTHOR 🫢

This man page was written by Daniel Walsh <dwalsh@redhat.com> β€” thank you for your service, king πŸŽ€


and that's the whole page, bestie!! this version is dated 20130617 and it lives in the semanage-login(8) manual, so if you ever forget where you read it, that's the citation right there πŸ’œ mwah, go map some users, you're doing amazing 🌟