1

我已经为树莓派设置了一个带 Fedora 28 的 SD 卡。因为我不想在 Pi 上测试 Docker,所以我尝试使用 fstransform 将根分区转换为 xfs,效果非常好。现在,当我将 sd 卡插入 Pi 时,系统正常启动。首次启动时,系统设置屏幕出现,我可以设置 root 密码并创建一个新用户(无需密码进行测试)。设置后,我尝试使用两个用户登录,但在登录后我再次注销。

用于登录 sd 卡的系统日志部分如下所示:

Aug 25 09:15:46 localhost audit[951]: USER_AUTH pid=951 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:kernel_t:s0 msg='op=PAM:authentication grantors=pam_unix acct="root" exe="/usr/bin/login" hostn
Aug 25 09:15:46 localhost audit[951]: USER_ACCT pid=951 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:kernel_t:s0 msg='op=PAM:accounting grantors=pam_unix acct="root" exe="/usr/bin/login" hostname=
Aug 25 09:15:46 localhost audit[951]: CRED_ACQ pid=951 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:kernel_t:s0 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/login" hostname=loca
Aug 25 09:15:46 localhost audit[951]: USER_ROLE_CHANGE pid=951 uid=0 auid=0 ses=11 subj=system_u:system_r:kernel_t:s0 msg='pam: default-context=unconfined_u:unconfined_r:unconfined_t:s0 selected-context=unconfin
Aug 25 09:15:46 localhost systemd[1]: Created slice User Slice of root.
Aug 25 09:15:46 localhost systemd[1]: Starting User Manager for UID 0...
Aug 25 09:15:46 localhost systemd-logind[640]: New session 11 of user root.
Aug 25 09:15:46 localhost systemd[1]: Started Session 11 of user root.
Aug 25 09:15:46 localhost systemd[1]: Started Getty on tty6.
Aug 25 09:15:46 localhost audit[953]: USER_ACCT pid=953 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:kernel_t:s0 msg='op=PAM:accounting grantors=pam_unix acct="root" exe="/usr/lib/systemd/systemd"
Aug 25 09:15:46 localhost audit[953]: USER_ROLE_CHANGE pid=953 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:kernel_t:s0 msg='pam: default-context=unconfined_u:unconfined_r:unconfined_t:s0 selected
Aug 25 09:15:46 localhost systemd[953]: pam_unix(systemd-user:session): session opened for user root by (uid=0)
Aug 25 09:15:46 localhost audit[953]: USER_START pid=953 uid=0 auid=0 ses=12 subj=system_u:system_r:kernel_t:s0 msg='op=PAM:session_open grantors=pam_selinux,pam_selinux,pam_loginuid,pam_keyinit,pam_limits,pam_s
Aug 25 09:15:46 localhost audit[953]: AVC avc:  denied  { transition } for  pid=953 comm="(systemd)" path="/usr/lib/systemd/systemd" dev="mmcblk0p4" ino=16969648 scontext=system_u:system_r:kernel_t:s0 tcontext=u
Aug 25 09:15:46 localhost systemd[953]: user@0.service: Failed to execute command: Permission denied
Aug 25 09:15:46 localhost systemd[953]: user@0.service: Failed at step EXEC spawning /usr/lib/systemd/systemd: Permission denied
Aug 25 09:15:46 localhost systemd[1]: user@0.service: Failed with result 'protocol'.
Aug 25 09:15:46 localhost systemd[1]: Failed to start User Manager for UID 0.
Aug 25 09:15:46 localhost audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:kernel_t:s0 msg='unit=user@0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? te
Aug 25 09:15:46 localhost login[951]: pam_systemd(login:session): Failed to create session: Start job for unit user@0.service failed with 'failed'
Aug 25 09:15:46 localhost login[951]: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
Aug 25 09:15:46 localhost audit[951]: USER_START pid=951 uid=0 auid=0 ses=11 subj=system_u:system_r:kernel_t:s0 msg='op=PAM:session_open grantors=pam_selinux,pam_loginuid,pam_console,pam_selinux,pam_namespace,pa
Aug 25 09:15:46 localhost audit[951]: CRED_REFR pid=951 uid=0 auid=0 ses=11 subj=system_u:system_r:kernel_t:s0 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/login" hostname=localhost addr=? ter
Aug 25 09:15:46 localhost audit[951]: USER_LOGIN pid=951 uid=0 auid=0 ses=11 subj=system_u:system_r:kernel_t:s0 msg='op=login id=0 exe="/usr/bin/login" hostname=localhost addr=? terminal=tty6 res=success'
Aug 25 09:15:46 localhost login[951]: ROOT LOGIN ON tty6
Aug 25 09:15:46 localhost audit[955]: AVC avc:  denied  { transition } for  pid=955 comm="login" path="/usr/bin/bash" dev="mmcblk0p4" ino=33781637 scontext=system_u:system_r:kernel_t:s0 tcontext=unconfined_u:unc
Aug 25 09:15:46 localhost audit[951]: CRED_DISP pid=951 uid=0 auid=0 ses=11 subj=system_u:system_r:kernel_t:s0 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/login" hostname=localhost addr=? ter
Aug 25 09:15:46 localhost login[951]: pam_unix(login:session): session closed for user root
Aug 25 09:15:46 localhost audit[951]: USER_END pid=951 uid=0 auid=0 ses=11 subj=system_u:system_r:kernel_t:s0 msg='op=PAM:session_close grantors=pam_selinux,pam_loginuid,pam_console,pam_selinux,pam_namespace,pam
Aug 25 09:15:46 localhost audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:kernel_t:s0 msg='unit=getty@tty6 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=?
Aug 25 09:15:46 localhost systemd[1]: getty@tty6.service: Service has no hold-off time, scheduling restart.
Aug 25 09:15:46 localhost systemd[1]: getty@tty6.service: Scheduled restart job, restart counter is at 2.
Aug 25 09:15:46 localhost systemd[1]: Stopped Getty on tty6.

当我尝试通过 ssh 连接到 Pi 时,管道损坏。

packet_write_wait: Connection to 192.168.20.150 port 22: Broken pipe

此时我检查了文件 /usr/lib/systemd/systemd 的权限,但它们设置正确:

4 drwxr-xr-x.  14 root root     4096 25. Apr 08:17 systemd

有人对此有解决方案吗?

4

0 回答 0