From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Restore SELinux default file contexts
From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security
Restore SELinux default file contexts
- (Narrator)In standard Unix permissions the file permissions are stored with the file. With SELinux, the security context is also stored with the file, in the extended attributes area. However, there are default security context settings stored in the SELinux security policy itself. These default settings, may see that all files in slash home have a certain type. Let's take a look. Type ls -lz /home and hit enter Notice that the security context of slash home is, user_home_dir_t. We can change the security context of any file, using the chcon command. Let's make a file called, newfile.txt in our home directory, by typing, touch newfile.txt, and hit enter. Let's verify the context using ls. Typing, ls -lz and hit enter. We can see that its type is, user_home_t. Now let's change the type to something else. Note, that we don't need to elevate privileges, when we're doing this to our own files. If you want to change the context of files, belonging to another user, you'll need to elevate…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Set enforcing and permissive modes for SELinux5m 13s
-
(Locked)
List and identify SELinux file and process context3m 28s
-
(Locked)
Restore SELinux default file contexts4m 11s
-
(Locked)
Use Booleans to modify SELinux behavior2m 33s
-
(Locked)
Diagnose routine SELinux policy violations6m 57s
-
(Locked)
Maintain security context when managing files1m 6s
-
(Locked)
Manage firewalls with firewalld2m 58s
-
(Locked)
Challenge: Manage security3m 55s
-
(Locked)
Solution: Manage security6m 18s
-
-
-
-
-