Ricerca

Questo contenuto non è disponibile nella lingua selezionata.

5.11.3. Creating a User With a Specific MLS Range

download PDF
Follow these steps to create a new Linux user with a specific MLS range:
  1. Add a new Linux user via the useradd command and map the new Linux user to an existing SELinux user (in this case, user_u):
    ~]# useradd -Z user_u john
  2. Assign the newly-created Linux user a password:
    ~]# passwd john
  3. Run the semanage login -l command to view the mapping between SELinux and Linux users. The output should be as follows:
    Login Name                SELinux User              MLS/MCS Range
    
    __default__               user_u                    s0
    john                      user_u                    s0
    root                      root                      s0-s15:c0.c1023
    system_u                  system_u                  s0-s15:c0.c1023
    
  4. Define a specific range for user john:
    ~]# semanage login --modify --seuser user_u --range s2:c100 john
  5. Run the semanage login -l command to view the mapping between SELinux and Linux users. Note that the user john now has a specific MLS range defined:
    Login Name                SELinux User              MLS/MCS Range
    
    __default__               user_u                    s0
    john                      user_u                    s2:c100
    root                      root                      s0-s15:c0.c1023
    system_u                  system_u                  s0-s15:c0.c1023
    
  6. To correct the label on john's home directory (if needed), run the following command:
    ~]# chcon -R -l s2:c100 /home/john
Red Hat logoGithubRedditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita ilBlog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

© 2024 Red Hat, Inc.