SELinux - 允许 system_u 和新的 SELinux 用户通过 SSH 登录

SELinux - 允许 system_u 和新的 SELinux 用户通过 SSH 登录

我是 SELinux 的新手,仍在尝试弄清楚一切是如何运作的,但我的目标是创建一个与 system_u 或新 SELinux 用户关联的 Linux 帐户,并尝试使用该帐户通过 ssh 连接到我的计算机。但是,当我尝试使用这样的帐户通过 ssh 连接到强制模式下的计算机时,我收到以下消息

无法获取用户的有效上下文

,尽管我仍然可以以 root 或 guest_u 帐户身份登录

尝试以 system_u 用户身份进行 ssh 时,以下消息将记录到 /var/log/secure 文件中

4 月 23 日 23:38:01 localhost sshd[1674]: 已接受来自 192.168.56.1 端口 55856 ssh2 的 systemUser 密码

4 月 23 日 23:38:01 localhost sshd[1674]: pam_selinux(sshd:session): 安全上下文 system_u:system_r:prelink_mask_t:s0-s0:c0.c1023 不允许用于 system_u:system_r:prelink_mask_t:s0-s0:c0.c1023

4 月 23 日 23:38:01 localhost sshd[1674]: pam_selinux(sshd:session): 无法获取 systemUser 的有效上下文

4 月 23 日 23:38:01 localhost sshd[1674]: pam_unix(sshd:session): 会话已为用户 systemUser 打开 (uid=0)

4 月 23 日 23:38:01 localhost sshd[1674]: 错误:PAM: pam_open_session(): 身份验证失败

4 月 23 日 23:38:01 localhost sshd[1674]: 错误:ssh_selinux_setup_pty: security_compute_relabel: 参数无效

4 月 23 日 23:38:01 localhost sshd[1678]: 收到来自 192.168.56.1 的断开连接:11: 用户断开连接

关于如何修改造成这种行为的策略,您有什么想法吗?

我正在使用 CentOS 6.8

答案1

我遇到了同样的问题,并通过重新启动解决了它sshd。可能适用于您的情况¯\_(ツ)_/¯...

相关内容