SELinux 拦截导致服务起不来,先看审计日志再改策略

先看审计日志,别急着关 SELinux。

ausearch 筛 AVC 记录能看到被拒的进程和目标路径。

标签不对用 semanage fcontext 改规则后 restorecon,缺能力用 setsebool -P 开布尔值。

需要自定义策略时用 audit2allow 生成模块装上,别用 chcon 改标签。

ausearch -m avc -ts today
semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
restorecon -Rv /web
setsebool -P httpd_can_network_connect on
ausearch -m avc -ts recent | audit2allow -M mypolicy
semodule -i mypolicy.pp
THE END
喜欢就支持一下吧
点赞10 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容