LiNUX Lab

Configure SELinux and Add - Restore Security Contexts

We deploy the real environment, you take the scenario-based labs on us. Hands-on, from anywhere, at any time.

Time required: 1 Hours

Scope

Use the provided lab server to perform the tasks outlined in the scenario section.

Suggested Pre Requisites

Tasks are to be performed as the root user.

Objectives

In this lab we ensure selinux is enabled.  We then add software.  Then we create a file, move it and restore its selinux context.

Overview

In this lab we ensure selinux is enabled.  We then add software.  Then we create a file, move it and restore its selinux context.

Make sure you are completing this lab as the root user.

Scenarios

One of the servers you are responsible for may be having SELinux issues. Once you log in, you will need to verify the SELinux is running in the 'Enforcing' mode.

After examining the security contexts of any files in the /root home directory, install the Apache web server and the Elinks text web browser for use during testing.

You want to test whether security contexts for created files are being replicated properly as files are moved from location to location. Create an 'index.html' in the /root directory and display the file security context once it is created. Move that file to the default web root of /var/www/html and change the user and group ownership to 'apache' while changing rights to '775' once moved.

Using the 'elinks' browser, bring up the localhost default Apache site (starting the Apache service if needed). If the created and move 'index.html' will not display, display and note the security context information for the /var/www/html directory and apply that context to any files currently within it. Verify the changes by trying to view the default site again.

Share our Labs
Start Your Free Trial

We have the longest and most in depth courses about cloud and engineering topics on the web. All of our training content is included with every membership.