- 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.
- 通信工程設(shè)計(jì)與案例
- 飛利浦/JVC新型彩色電視機(jī)速修圖解
- 電子產(chǎn)品零部件檢測與選用技能演練
- 半導(dǎo)體光電子學(xué)
- 快修巧修新型等離子和高清晰度電視機(jī)
- 零起點(diǎn)學(xué)音響與影碟機(jī)維修技術(shù)
- 面向5G的智能光承載網(wǎng)規(guī)劃與運(yùn)維實(shí)踐
- 電路基礎(chǔ)實(shí)驗(yàn)與實(shí)踐
- 5G移動(dòng)終端多天線技術(shù)
- 如影隨形:無處不在的無線電波
- 光纖通信技術(shù)及應(yīng)用
- 5G改變世界
- 5G網(wǎng)絡(luò)建設(shè)實(shí)踐與模式創(chuàng)新
- Kamailio實(shí)戰(zhàn)
- 電工與電子技術(shù)及技能訓(xùn)練