Este contenido no está disponible en el idioma seleccionado.
5.11.3. Creating a User With a Specific MLS Range
Follow these steps to create a new Linux user with a specific MLS range:
- Add a new Linux user via the
useraddcommand and map the new Linux user to an existing SELinux user (in this case,user_u):useradd -Z user_u john
~]# useradd -Z user_u johnCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Assign the newly-created Linux user a password:
passwd john
~]# passwd johnCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the
semanage login -lcommand to view the mapping between SELinux and Linux users. The output should be as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Define a specific range for user
john:semanage login --modify --seuser user_u --range s2:c100 john
~]# semanage login --modify --seuser user_u --range s2:c100 johnCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the
semanage login -lcommand to view the mapping between SELinux and Linux users. Note that the userjohnnow has a specific MLS range defined:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To correct the label on john's home directory (if needed), run the following command:
chcon -R -l s2:c100 /home/john
~]# chcon -R -l s2:c100 /home/johnCopy to Clipboard Copied! Toggle word wrap Toggle overflow