Displaying SELinux User Mapping

This task shows you how to view the mapping between SELinux and Linux user accounts using the semanage command.

  1. List all SELinux users.

    Run the following command to show all SELinux user accounts:

    seinfo -u

    The output is similar to the following:

    Users: 8
    guest_u
    root
    staff_u
    sysadm_u
    system_u
    unconfined_u
    user_u
    xguest_u
  2. Show which Linux user accounts are mapped to which SELinux user accounts.

    Run the following command to display the mappings:

    sudo semanage login -l

    The output is similar to the following:

    Login Name           SELinux User         MLS/MCS Range        Service
    
    __default__          unconfined_u         s0-s0:c0.c1023       *
    root                 unconfined_u         s0-s0:c0.c1023       *
    system_u             system_u             s0-s0:c0.c1023       *

    By default, SELinux maps Linux users other than root and the default system-level user, system_u, to the Linux __default__ user, and in turn to the SELinux unconfined_u user. The MLS/MCS Range is the security level used by Multi-Level Security (MLS) and Multi-Category Security (MCS).