Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning RHEL Networking

You're reading from   Learning RHEL Networking Gain Linux administration skills by learning new networking concepts in Red Hat Enterprise Linux 7

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785287831
Length 216 pages
Edition 1st Edition
Arrow right icon
Toc

Table of Contents (13) Chapters Close

Preface 1. Introducing Enterprise Linux 7 FREE CHAPTER 2. Configuring Network Settings 3. Configuring Key Network Services 4. Implementing iSCSI SANs 5. Implementing btrfs 6. File Sharing with NFS 7. Implementing Windows Shares with Samba 4 8. Integrating RHEL 7 into Microsoft Active Directory Domains 9. Deploying the Apache HTTPD Server 10. Securing the System with SELinux 11. Network Security with firewalld Index

SELinux tools


Let's take a look at SELinux tools.

chcon and restorecon

Two of the main tools that we can use to help manage SELinux are chcon and restorecon. The chcon command helps to change the SELinux context or TYPE of what will most often be a single or perhaps sometimes a few files that can be referenced easily together with some form of wildcard. The restorecon command can be used to reset a file or directory and its contents to their default SELinux context. These default settings for directories are stored in the /etc/selinux/targeted/contexts/files/file-context file.

With grep, we can search for httpd_sys_content_t, whereas in the output, we should see the default label for files under /var/www. This is the directory were we would expect to find web server content:

# grep httpd_sys_content_t \ 
/etc/selinux/targeted/contexts/files/file_contexts

The output of the preceding command is as follows:

/var/www(/.*)? system_u:object_r:httpd_sys_content_t:s0

We can now try to break the system...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime