官术网_书友最值得收藏!

Introduction

Setting, resetting, and governing file labels are the most common tasks administrators have to perform on an SELinux-enabled system. The policies that are provided by policy developers as well as Linux distributions offer sane defaults to use, but many implementations harbor different locations for services and files. Companies often install their custom scripts and logfiles in nondefault locations, and many daemons can be configured to support multiple instances on the same system—each of them using a different base directory.

System administrators will know how to set context definitions through the semanage application and then reset the contexts of the target files using setfiles or restorecon:

~# semanage fcontext –a –t httpd_sys_content_t "/srv/web/zone/htdocs(/.*)?"
~# restorecon –RF /srv/web/zone/htdocs

This, however, is a local definition, which, if necessary, needs to be exported and imported in order to transfer it to other systems:

~# semanage export -f local_selinux.mods
~# semanage import -f local_selinux.mods

By moving context definitions into the SELinux policy realm, such definitions can be easily installed on multiple systems and managed centrally as we've seen for SELinux policy modules.

主站蜘蛛池模板: 徐州市| 北票市| 泗阳县| 周至县| 长丰县| 赣榆县| 吴桥县| 南涧| 大化| 揭阳市| 牡丹江市| 阳曲县| 永宁县| 拉萨市| 东源县| 胶南市| 巴彦淖尔市| 横峰县| 蒙自县| 龙海市| 玛曲县| 白城市| 高密市| 梁平县| 伊吾县| 北安市| 竹溪县| 宁乡县| 滦平县| 嘉禾县| 大荔县| 吴忠市| 周至县| 武山县| 白山市| 当涂县| 邯郸市| 邮箱| 沿河| 时尚| 林甸县|