我试图在启用selinux的情况下在centos 7上部署jupyterhub。 我selectsudospawner创build新的jupyter笔记本服务器。 当我尝试login到jupyterhub时,selinuxlogging以下错误没有过程被产生:
python3.4[17888]: pam_selinux(login:session): Error sending audit message. python3.4[17888]: pam_keyinit(login:session): Unable to change GID to 1000 temporarily python3.4[17888]: pam_keyinit(login:session): Unable to change GID to 1000 temporarily dbus[633]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.1187" (uid=1003 pid=17888 comm="/usr/bin/python3.4 /usr/bin/jupyterhub ") interface="org.freedesktop.login1.Manager" member="CreateSession" error name="(unset)" requested_reply="0" destination="org.freedesktop.login1" (uid=0 pid=632 comm="/usr/lib/systemd/systemd-logind ") dbus-daemon[633]: dbus[633]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.1187" (uid=1003 pid=17888 comm="/usr/bin/python3.4 /usr/bin/jupyterhub ") interface="org.freedesktop.login1.Manager" member="CreateSession" error name="(unset)" requested_reply="0" destination="org.freedesktop.login1" (uid=0 pid=632 comm="/usr/lib/systemd/systemd-logind ") python3.4[17888]: pam_systemd(login:session): Failed to create session: Access denied
即使当我以root身份启动jupyterhub时,我也会得到这个错误。 当我禁用SELinux,一切工作正常。
如何configurationselinux sudospawner可以设置uid并在用户环境中启动笔记本服务器?
你需要做的第一件事是收集所有相关的SELinux消息。 将您的系统置于宽容模式
setenforce 0
正常使用该应用程序,然后查看/var/log/audit/audit.log*的SELinux相关消息
grep denied /var/log/audit/audit.log*
您可以将结果传递给各种实用程序,以了解需要什么
grep denied /var/log/audit/audit.log* | audit2why
分析可能会有帮助。 它可能build议你configuration各种布尔值。 您可能还想通过audit2allow运行结果
grep denied /var/log/audit/audit.log* | audit2allow
这也会告诉你你需要做什么。 您可以创build一个本地模块
grep denied /var/log/audit/audit.log* | audit2allow -M local-module
然后使用它
semodule -i local-module.pp
不要忘记把SELinux设置回执行。