- A Cloud Guru
Granting `sudo` Privileges to Confined Users
In this lab, we'll review the process of granting `sudo` privileges to SELinux confined users. When working with SELinux confined users, you may run into problems with Linux users not being able to use `sudo` anymore. We'll discuss why this happens and how to resolve the issue. *This course is not approved or sponsored by Red Hat.*
Table of Contents
Map `pbeesly` and `jhalpert` to the Appropriate SELinux User
- Become root.
- Run the following commands to map
semanage login -a -s "staff_u" pbeesly semanage login -a -s "staff_u" jhalpert
Add `pbeesly` and `jhalpert` to the `sudoers` File
- Open the
/and search for the line
root ALL=(ALL) ALL.
- Add the following two lines under the line
root ALL=(ALL) ALL:
pbeesly ALL=(ALL) TYPE=administrator_t ROLE=administrator_r /bin/sh jhalpert ALL=(ALL) TYPE=administrator_t ROLE=administrator_r /bin/sh
- Open the
Update the SELinux Security Context of Each User's Home Directory
- Run the following commands to update the SELinux security context of each user's home directory:
restorecon -FR -v /home/pbeesly restorecon -FR -v /home/jhalpert
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.