|
SELinux 需要知道 SELinux 设置的关闭或打开的一系列布尔值:
- 查看所有的布尔值:
# getsebool -a
- 查看每个布尔值的描述:
# semanage boolean -l
- 设置某个布尔值:
# setsebool [_boolean_] [1|0]
- 将它配置为永久值,添加
-P 标志。例如:# setsebool httpd_enable_ftp_server 1 -P
SELinux 策略/应用可能有 bug,包括:
- 不寻常的代码路径
- 配置
- 重定向
stdout
- 泄露的文件描述符
- 可执行内存
- 错误构建的库
开一个工单(但不要提交 Bugzilla 报告;使用 Bugzilla 没有对应的服务)
你的信息可能被损坏了,假如你被限制在某个区域,尝试这样做:
- 加载内核模块
- 关闭 SELinux 的强制模式
- 写入
etc_t/shadow_t
- 修改 iptables 规则
用于开发策略模块的 SELinux 工具:# yum -y install setroubleshoot setroubleshoot-server。安装完成之后重引导机器或重启 auditd 服务。
使用 journalctl 去列出所有与 setroubleshoot 相关的日志:# journalctl -t setroubleshoot --since=14:20
使用 journalctl 去列出所有与特定 SELinux 标签相关的日志。例如:# journalctl _SELINUX_CONTEXT=system_u:system_r:policykit_t:s0
当 SELinux 错误发生时,使用setroubleshoot 的日志,并尝试找到某些可能的解决方法。例如:从 journalctl 中:
Jun 14 19:41:07 web1 setroubleshoot: SELinux is preventing httpd from getattr access on the file /var/www/html/index.html. For complete message run: sealert -l 12fd8b04-0119-4077-a710-2d0e0ee5755e-
# sealert -l 12fd8b04-0119-4077-a710-2d0e0ee5755eSELinux is preventing httpd from getattr access on the file /var/www/html/index.html.-
***** Plugin restorecon (99.5 confidence) suggests ************************-
If you want to fix the label,/var/www/html/index.html default label should be httpd_syscontent_t.Then you can restorecon.Do# /sbin/restorecon -v /var/www/html/index.html
(编辑:无锡站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|