Skip to Content
SELinux Cookbook
book

SELinux Cookbook

by Sven Vermeulen
September 2014
Intermediate to advanced
240 pages
5h 53m
English
Packt Publishing
Content preview from SELinux Cookbook

Mapping Linux users to SELinux users

With the SELinux users available, we can now map Linux users to SELinux users. This will ensure that the users, when logged in to the system, are assigned a default context aligned with this SELinux user.

How to do it…

In order to map Linux users to SELinux users, the following steps can be taken:

  1. List the existing mappings with semanage login:
    ~# semanage login -l
    Login Name           SELinux User              MLS/MCS Range
    
    __default__          user_u                    s0-s0:c0.c1023
    root                 root                      s0-s0:c0.c1023
    system_u             system_u                  s0-s0:c0.c1023
    %wheel               sysadm_u                  s0-s0:c0.c1023
    
  2. For an individual user account, map the account to an SELinux user with semanage login:
    ~# semanage login -a -s dbadm_u user1
    
  3. It is also possible to assign a group of users to an SELinux user ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SELinux

SELinux

Bill McCarty
SELinux by Example: Using Security Enhanced Linux

SELinux by Example: Using Security Enhanced Linux

Frank Mayer, Karl MacMillan, David Caplan
CentOS Quick Start Guide

CentOS Quick Start Guide

Shiwang Kalkhanda

Publisher Resources

ISBN: 9781783989669Supplemental Content