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

  • SELinux Cookbook
  • Sven Vermeulen
  • 183字
  • 2021-08-05 18:02:18

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.

主站蜘蛛池模板: 邻水| 凉山| 武山县| 呼伦贝尔市| 古浪县| 项城市| 佛山市| 厦门市| 武功县| 栾川县| 永春县| 板桥市| 九龙坡区| 中山市| 体育| 衡东县| 本溪市| 湘潭市| 清涧县| 新巴尔虎右旗| 绥阳县| 定州市| 博兴县| 宣恩县| 丹凤县| 阿图什市| 栾城县| 深圳市| 沙坪坝区| 司法| 恭城| 崇礼县| 沙河市| 互助| 呼伦贝尔市| 黑山县| 白河县| 云安县| 齐齐哈尔市| 大洼县| 保亭|