SELinux – Change context.

By | 13/08/2019

Processes and files are labeled with an SELinux context that contains additional information, such as an SELinux user, role, type, and, optionally, a level. When running SELinux, all of this information is used to make access control decisions.
Let’s test this with httpd sercice and index.html file.
You need to start this service on Fedora.
Using these commands we can see the context of this file.
I will change this context and restore it.
Let’s start with the first steps:

You can see the index.html on localhost:

Let’s change the context. The result on Fedora will be the apache default page.
You can get back the selinux context of file with this command:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.