Skip to Content
Mastering Linux Security and Hardening - Second Edition
book

Mastering Linux Security and Hardening - Second Edition

by Donald A. Tevault
February 2020
Intermediate to advanced
666 pages
15h 45m
English
Packt Publishing
Content preview from Mastering Linux Security and Hardening - Second Edition

Using semanage

In the scenario I've just presented, either chcon or restorecon will suit your needs just fine. The active SELinux policy mandates what security contexts in certain directories are supposed to look like. As long as you're using chcon or restorecon within directories that are defined in the active SELinux policy, you're good. But let's say that you've created a directory elsewhere that you want to use to serve out web content files. You would need to set the httpd_sys_content_t type on that directory and all of the files within it. However, if you use chcon or restorecon for that, the change won't survive a system reboot. To make the change permanent, you'll need to use semanage.

Let's say that, for some strange reason, I want ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Security and Hardening - Third Edition

Mastering Linux Security and Hardening - Third Edition

Donald A. Tevault
UNIX and Linux System Administration Handbook, 5th Edition

UNIX and Linux System Administration Handbook, 5th Edition

Trent R. Hein, Evi Nemeth, Garth Snyder, Ben Whaley, Dan Mackin

Publisher Resources

ISBN: 9781838981778Supplemental Content