Introduction
In this challenge, you will practice identifying and modifying SELinux file contexts on a Red Hat Enterprise Linux (RHEL) system. SELinux (Security-Enhanced Linux) is a critical security mechanism that provides mandatory access control (MAC). Understanding how to work with SELinux file contexts is essential for system administration and security management.
Identify and Modify SELinux File Context
Your first task is to work with SELinux contexts on files. You will create a new file, inspect its default SELinux context, and then modify its type context.
Tasks
- Create a new, empty file named
example.txt. - View the full SELinux context of the
example.txtfile. - Change the SELinux type context of
example.txttoadmin_home_t.
Requirements
- All operations must be performed within the
~/projectdirectory. - The file must be named
example.txt. - Use the
ls -Zcommand to view the file context. - Use the
chconcommand to modify the file context. The final type context must beadmin_home_t.
Summary
In this challenge, you have successfully practiced fundamental SELinux file context management. You learned how to view the security context of files using ls -Z and modify them temporarily with chcon. These skills are foundational for managing a secure RHEL system and understanding how SELinux contexts work.



