【问题标题】:selinux and starting init process from httpdselinux 并从 httpd 启动 init 进程
【发布时间】:2012-10-12 11:19:45
【问题描述】:

操作系统:RHEL6 和 CentOS6

当启动ntpd(/etc/init.d/ntpd start)等服务时,进程将拥有selinux上下文:

system_u:system_r:ntpd_t:s0

如果我的 cgi 是 root 的 setuid,它将允许通过 Web 界面停止/启动服务,当通过这个 cgi(执行相同的 /etc/init.d/ntpd start)启动时,该进程具有 selinux 上下文:

system_u:system_r:httpd_t:s0

我的 cgi 文件 selinux 上下文:

system_u:system_r:unconfined_exec_t:s0

当服务通过执行/etc/init.d script 启动服务的httpd/cgi suid 进程启动时,我该如何做到这一点,该进程的类型是否正确? (本例中为ntpd_t

【问题讨论】:

    标签: rhel selinux


    【解决方案1】:

    原因是 SELinux 中的域之间存在转换,所以它意味着哪个进程和什么上下文类型运行/启动什么进程和从什么文件(什么 SELinux 上下文)。因此 sysV 或 systemd 默认从 systemd_t 或其他方式启动服务,但您的 Web 服务器尝试从 httpd_t 启动服务。 Google 如何在 SELinux 中更改域。

    【讨论】:

      猜你喜欢
      • 2017-05-31
      • 2014-09-24
      • 1970-01-01
      • 1970-01-01
      • 2019-04-26
      • 1970-01-01
      • 1970-01-01
      • 2021-11-04
      • 1970-01-01
      相关资源
      最近更新 更多