O'Reilly logo

Learning RHEL Networking by Andrew Mallett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required