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

Managing SELinux users

In order to grant a Linux login the right set of roles, we first need to create an SELinux user that has just those roles assigned. Existing SELinux users can be modified easily, and if an SELinux user was added previously, it can be removed from the system as well.

How to do it…

Managing SELinux users is done as follows:

  1. Use semanage user to list the currently available SELinux users:
    ~# semanage user -l
                    Labeling   MLS/       MLS/
    SELinux User    Prefix     MCS Level  MCS Range                      SELinux Roles
    
    git_shell_u     user       s0         s0                             git_shell_r
    guest_u         user       s0         s0                             guest_r
    root            user       s0         s0-s0:c0.c1023                 staff_r sysadm_r system_r unconfined_r
    staff_u         user       s0         s0-s0:c0.c1023                 staff_r sysadm_r system_r unconfined_r
    sysadm_u        user       s0         s0-s0:c0.c1023                 sysadm_r
    system_u 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